Skip to content

Commit 6b28f33

Browse files
author
Matthew Gretton-Dann
committed
C++: Update test for fix to namespace members
Generation of IDs for namespace members has been fixed to generate unique IDs for variables of the same name but in different namespaces. Update the same_name test to validate this.
1 parent 22e57a6 commit 6b28f33

File tree

2 files changed

+3
-6
lines changed

2 files changed

+3
-6
lines changed

cpp/ql/test/library-tests/namespaces/same_name/decls.expected

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,5 +7,6 @@
77
| file://:0:0:0:0 | (global namespace) | file://:0:0:0:0 | p#0 |
88
| file://:0:0:0:0 | (global namespace) | file://:0:0:0:0 | p#0 |
99
| file://:0:0:0:0 | (global namespace) | file://:0:0:0:0 | reg_save_area |
10-
| same_name.cpp:4:11:4:21 | namespace_a | same_name.cpp:2:11:2:11 | c |
10+
| file://:0:0:0:0 | (global namespace) | same_name.cpp:2:11:2:11 | c |
1111
| same_name.cpp:4:11:4:21 | namespace_a | same_name.cpp:6:12:6:12 | c |
12+
| same_name.cpp:9:11:9:21 | namespace_b | same_name.cpp:11:12:11:12 | c |

cpp/ql/test/library-tests/namespaces/same_name/same_name.cpp

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,5 @@ namespace namespace_a
88

99
namespace namespace_b
1010
{
11-
//const int c = 1;
12-
//
13-
// this example is causing a DBCheck failure along the lines of:
14-
//
15-
// [INVALID_KEY] Relation namespacembrs((@namespace parentid, unique @namespacembr memberid)): Value 132 of key field memberid occurs in several tuples. Two such tuples are: (134,132) and (144,132)
11+
const int c = 1;
1612
}

0 commit comments

Comments
 (0)