File tree 2 files changed +24
-0
lines changed
2 files changed +24
-0
lines changed Original file line number Diff line number Diff line change @@ -144,6 +144,11 @@ class symbol_table_baset
144
144
typedef symbolst::const_iterator::reference reference; // NOLINT
145
145
typedef symbolst::iterator::iterator_category iterator_category; // NOLINT
146
146
147
+ bool operator !=(const iteratort &other) const
148
+ {
149
+ return it != other.it ;
150
+ }
151
+
147
152
bool operator ==(const iteratort &other) const
148
153
{
149
154
return it == other.it ;
Original file line number Diff line number Diff line change 5
5
#include < testing-utils/catch.hpp>
6
6
#include < util/journalling_symbol_table.h>
7
7
8
+ TEST_CASE (" Iterating through a symbol table" , " [core][utils][symbol_tablet]" )
9
+ {
10
+ symbol_tablet symbol_table;
11
+
12
+ symbolt symbol;
13
+ irep_idt symbol_name = " Test" ;
14
+ symbol.name = symbol_name;
15
+
16
+ symbol_table.insert (symbol);
17
+
18
+ int counter = 0 ;
19
+ for (auto &entry : symbol_table)
20
+ {
21
+ ++counter;
22
+ }
23
+
24
+ REQUIRE (counter == 1 );
25
+ }
26
+
8
27
SCENARIO (" journalling_symbol_table_writer" ,
9
28
" [core][utils][journalling_symbol_table_writer]" )
10
29
{
You can’t perform that action at this time.
0 commit comments