Skip to content

Commit 4294ed8

Browse files
ludviggunneLudvig Gunne Lindström
authored and
Ludvig Gunne Lindström
committed
import posix library in memcpy tests
1 parent 4c73898 commit 4294ed8

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

test/testleakautovar.cpp

+4-2
Original file line numberDiff line numberDiff line change
@@ -637,21 +637,23 @@ class TestLeakAutoVar : public TestFixture {
637637
}
638638

639639
void memcpyWithPtr1() { // #11542
640+
const Settings s = settingsBuilder().library("std.cfg").library("posix.cfg").build();
640641
check("#include <string.h>\n"
641642
"void f(char** old, char* value) {\n"
642643
" char *str = strdup(value);\n"
643644
" memcpy(old, &str, sizeof(char*));\n"
644-
"}\n");
645+
"}\n", &s);
645646
ASSERT_EQUALS("", errout_str());
646647
}
647648

648649
void memcpyWithPtr2() {
650+
const Settings s = settingsBuilder().library("std.cfg").library("posix.cfg").build();
649651
check("#include <string.h>\n"
650652
"void f(char* value) {\n"
651653
" char *old = NULL;\n"
652654
" char *str = strdup(value);\n"
653655
" memcpy(&old, &str, sizeof(char*));\n"
654-
"}\n");
656+
"}\n", &s);
655657
// TODO: make this fail
656658
ASSERT_EQUALS("", errout_str());
657659
}

0 commit comments

Comments
 (0)