diff options
author | Vitaly Buka <vitalybuka@google.com> | 2019-09-12 02:20:36 +0000 |
---|---|---|
committer | Vitaly Buka <vitalybuka@google.com> | 2019-09-12 02:20:36 +0000 |
commit | d2af368aee56abf77f4a6ca3fd57ebdb697c48f2 (patch) | |
tree | 36057b4d4b1e3fd38d33027438c81834e88e100d /compiler-rt/lib/sanitizer_common/tests | |
parent | 6e8c21857ecb49b282c2ee4df434f27469647e5e (diff) | |
download | bcm5719-llvm-d2af368aee56abf77f4a6ca3fd57ebdb697c48f2.tar.gz bcm5719-llvm-d2af368aee56abf77f4a6ca3fd57ebdb697c48f2.zip |
[compiler-rt] Remove some cpplint filters
llvm-svn: 371704
Diffstat (limited to 'compiler-rt/lib/sanitizer_common/tests')
-rw-r--r-- | compiler-rt/lib/sanitizer_common/tests/sanitizer_printf_test.cpp | 10 | ||||
-rw-r--r-- | compiler-rt/lib/sanitizer_common/tests/sanitizer_suppressions_test.cpp | 2 |
2 files changed, 6 insertions, 6 deletions
diff --git a/compiler-rt/lib/sanitizer_common/tests/sanitizer_printf_test.cpp b/compiler-rt/lib/sanitizer_common/tests/sanitizer_printf_test.cpp index d213d107c01..956ed654501 100644 --- a/compiler-rt/lib/sanitizer_common/tests/sanitizer_printf_test.cpp +++ b/compiler-rt/lib/sanitizer_common/tests/sanitizer_printf_test.cpp @@ -33,7 +33,7 @@ TEST(Printf, Basic) { TEST(Printf, OverflowStr) { char buf[] = "123456789"; - uptr len = internal_snprintf(buf, 4, "%s", "abcdef"); + uptr len = internal_snprintf(buf, 4, "%s", "abcdef"); // NOLINT EXPECT_EQ(len, (uptr)6); EXPECT_STREQ("abc", buf); EXPECT_EQ(buf[3], 0); @@ -47,7 +47,7 @@ TEST(Printf, OverflowStr) { TEST(Printf, OverflowInt) { char buf[] = "123456789"; - internal_snprintf(buf, 4, "%d", -123456789); + internal_snprintf(buf, 4, "%d", -123456789); // NOLINT EXPECT_STREQ("-12", buf); EXPECT_EQ(buf[3], 0); EXPECT_EQ(buf[4], '5'); @@ -66,7 +66,7 @@ TEST(Printf, OverflowUint) { } else { val = (uptr)0x123456789ULL; } - internal_snprintf(buf, 4, "a%zx", val); + internal_snprintf(buf, 4, "a%zx", val); // NOLINT EXPECT_STREQ("a12", buf); EXPECT_EQ(buf[3], 0); EXPECT_EQ(buf[4], '5'); @@ -85,7 +85,7 @@ TEST(Printf, OverflowPtr) { } else { p = (void*)0x123456789ULL; } - internal_snprintf(buf, 4, "%p", p); + internal_snprintf(buf, 4, "%p", p); // NOLINT EXPECT_STREQ("0x0", buf); EXPECT_EQ(buf[3], 0); EXPECT_EQ(buf[4], '5'); @@ -149,7 +149,7 @@ TEST(Printf, Precision) { EXPECT_STREQ("12345 ", buf); // Check that width does not overflow the smaller buffer, although // 10 chars is requested, it stops at the buffer size, 8. - len = internal_snprintf(buf, 8, "%-10s", "12345"); + len = internal_snprintf(buf, 8, "%-10s", "12345"); // NOLINT EXPECT_EQ(10U, len); // The required size reported. EXPECT_STREQ("12345 ", buf); } diff --git a/compiler-rt/lib/sanitizer_common/tests/sanitizer_suppressions_test.cpp b/compiler-rt/lib/sanitizer_common/tests/sanitizer_suppressions_test.cpp index 6fce03a573b..50a6ce92f9b 100644 --- a/compiler-rt/lib/sanitizer_common/tests/sanitizer_suppressions_test.cpp +++ b/compiler-rt/lib/sanitizer_common/tests/sanitizer_suppressions_test.cpp @@ -18,7 +18,7 @@ namespace __sanitizer { static bool MyMatch(const char *templ, const char *func) { char tmp[1024]; - strcpy(tmp, templ); + snprintf(tmp, sizeof(tmp), "%s", templ); return TemplateMatch(tmp, func); } |