Enable LeakSanitizer for unit tests run via doctest

This commit is contained in:
Jon Siwek 2020-01-08 21:14:40 -08:00
parent 66ca20b737
commit a4089bc659
2 changed files with 2 additions and 0 deletions

View file

@ -454,6 +454,7 @@ int main(int argc, char** argv)
#else #else
doctest::Context context; doctest::Context context;
context.applyCommandLine(std::distance(first, separator), argv); context.applyCommandLine(std::distance(first, separator), argv);
ZEEK_LSAN_ENABLE();
return context.run(); return context.run();
#endif #endif
} }

View file

@ -167,6 +167,7 @@ TEST_CASE("util get_escaped_string")
{ {
ODesc* d = get_escaped_string(nullptr, "a bcd\n", 6, false); ODesc* d = get_escaped_string(nullptr, "a bcd\n", 6, false);
CHECK(strcmp(d->Description(), "a\\x20bcd\\x0a") == 0); CHECK(strcmp(d->Description(), "a\\x20bcd\\x0a") == 0);
delete d;
} }
SUBCASE("provided ODesc") SUBCASE("provided ODesc")