Skip to content

Commit cea7887

Browse files
committed
C++: Rename variables in tests to reflect their types
1 parent 7dbb191 commit cea7887

1 file changed

Lines changed: 8 additions & 8 deletions

File tree

  • cpp/ql/test/query-tests/Likely Bugs/Arithmetic/IntMultToLong

cpp/ql/test/query-tests/Likely Bugs/Arithmetic/IntMultToLong/IntMultToLong.c

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -93,12 +93,12 @@ size_t three_chars(unsigned char a, unsigned char b, unsigned char c) {
9393
return a * b * c; // at most 16581375
9494
}
9595

96-
void g(unsigned char a, unsigned char b, unsigned char b2, int c) {
97-
unsigned long d, e, f, g, h;
98-
d = (a + 1) * (b + 1); // GOOD
99-
e = (c + 1) * (b + 1); // BAD
100-
h = (a + 1) * (b + 1) * (b2 + 1); // GOOD
101-
102-
f = (a + (a + 1)) * (b + 1); // GOOD
103-
g = (c + (a + 1)) * (b + 1); // BAD
96+
void g(unsigned char uchar1, unsigned char uchar2, unsigned char uchar3, int i) {
97+
unsigned long ulong1, ulong2, ulong3, ulong4, ulong5;
98+
ulong1 = (uchar1 + 1) * (uchar2 + 1); // GOOD
99+
ulong2 = (i + 1) * (uchar2 + 1); // BAD
100+
ulong3 = (uchar1 + 1) * (uchar2 + 1) * (uchar3 + 1); // GOOD
101+
102+
ulong4 = (uchar1 + (uchar1 + 1)) * (uchar2 + 1); // GOOD
103+
ulong5 = (i + (uchar1 + 1)) * (uchar2 + 1); // BAD
104104
}

0 commit comments

Comments
 (0)