tsan: fix tests to consistently use internal functions (otherwise it leads to false positives)

llvm-svn: 171057
This commit is contained in:
Dmitry Vyukov 2012-12-25 09:20:58 +00:00
parent f0a014bbb7
commit 116518af74
2 changed files with 3 additions and 2 deletions

View File

@ -72,7 +72,7 @@ TEST(SanitizerCommon, MmapAlignedOrDie) {
uptr res = (uptr)MmapAlignedOrDie(
size * PageSize, alignment * PageSize, "MmapAlignedOrDieTest");
EXPECT_EQ(0U, res % (alignment * PageSize));
memset((void*)res, 1, size * PageSize);
internal_memset((void*)res, 1, size * PageSize);
UnmapOrDie((void*)res, size * PageSize);
}
}

View File

@ -12,6 +12,7 @@
//===----------------------------------------------------------------------===//
#include "sanitizer_common/sanitizer_common.h"
#include "sanitizer_common/sanitizer_flags.h"
#include "sanitizer_common/sanitizer_libc.h"
#include "gtest/gtest.h"
#include <string.h>
@ -31,7 +32,7 @@ static void TestStrFlag(const char *start_value, const char *env,
const char *final_value) {
const char *flag = start_value;
ParseFlag(env, &flag, kFlagName);
EXPECT_STREQ(final_value, flag);
EXPECT_EQ(internal_strcmp(final_value, flag), 0);
}
TEST(SanitizerCommon, BooleanFlags) {