Skip to content

Commit 0cbb275

Browse files
committed
Fix last commit.
1 parent 1ccae14 commit 0cbb275

File tree

2 files changed

+9
-9
lines changed

2 files changed

+9
-9
lines changed

Diff for: .gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -18,3 +18,4 @@ vendor
1818
*.bin.dSYM
1919
*.so
2020
*.so.dSYM
21+
.vscode

Diff for: SampleProjects/TestSomething/test/stdlib.cpp

+8-9
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@
88
unittest(library_tests_itoa)
99
{
1010
char buf[32];
11-
const char *result;
1211
struct {
1312
int value;
1413
const char *expected;
@@ -28,22 +27,22 @@ unittest(library_tests_itoa)
2827
};
2928

3029
for (int i = 0; i < ARRAY_SIZEOF(table); i++) {
30+
itoa(table[i].value, buf, table[i].base);
3131
for (int j = 0; j < strlen(buf); ++j) {
3232
buf[j] = toupper(buf[j]);
3333
}
34-
result = itoa(table[i].value, buf, table[i].base);
35-
assertEqual(table[i].expected, result);
34+
assertEqual(table[i].expected, buf);
3635
}
3736

3837
// While only bases 2, 8, 10 and 16 are of real interest, let's test that all
3938
// bases at least produce expected output for a few test points simple to test.
4039
for (int base = 2; base <= 16; base++) {
41-
result = itoa(0, buf, base);
42-
assertEqual("0", result);
43-
result = itoa(1, buf, base);
44-
assertEqual("1", result);
45-
result = itoa(base, buf, base);
46-
assertEqual("10", result);
40+
itoa(0, buf, base);
41+
assertEqual("0", buf);
42+
itoa(1, buf, base);
43+
assertEqual("1", buf);
44+
itoa(base, buf, base);
45+
assertEqual("10", buf);
4746
}
4847

4948
}

0 commit comments

Comments
 (0)