[NFC][compiler-rt][test] Fully qualify string -> std::string

This commit is contained in:
Jordan Rupprecht 2020-02-19 08:58:55 -08:00
parent b92b1701cd
commit 3f7d0e7e31
3 changed files with 23 additions and 23 deletions

View File

@ -39,12 +39,12 @@ enum class OOBKind {
Global,
};
string LeftOOBReadMessage(OOBKind oob_kind, int oob_distance) {
std::string LeftOOBReadMessage(OOBKind oob_kind, int oob_distance) {
return oob_kind == OOBKind::Stack ? kStackReadUnderflow
: ::LeftOOBReadMessage(oob_distance);
}
string RightOOBReadMessage(OOBKind oob_kind, int oob_distance) {
std::string RightOOBReadMessage(OOBKind oob_kind, int oob_distance) {
return oob_kind == OOBKind::Stack ? kStackReadOverflow
: ::RightOOBReadMessage(oob_distance);
}
@ -480,7 +480,7 @@ TEST(AddressSanitizer, StrNCatOOBTest) {
free(from);
}
static string OverlapErrorMessage(const string &func) {
static std::string OverlapErrorMessage(const std::string &func) {
return func + "-param-overlap";
}

View File

@ -739,7 +739,7 @@ TEST(AddressSanitizer, Store128Test) {
#endif
// FIXME: All tests that use this function should be turned into lit tests.
string RightOOBErrorMessage(int oob_distance, bool is_write) {
std::string RightOOBErrorMessage(int oob_distance, bool is_write) {
assert(oob_distance >= 0);
char expected_str[100];
sprintf(expected_str, ASAN_PCRE_DOTALL
@ -751,19 +751,19 @@ string RightOOBErrorMessage(int oob_distance, bool is_write) {
is_write ? "WRITE" : "READ",
#endif
oob_distance);
return string(expected_str);
return std::string(expected_str);
}
string RightOOBWriteMessage(int oob_distance) {
std::string RightOOBWriteMessage(int oob_distance) {
return RightOOBErrorMessage(oob_distance, /*is_write*/true);
}
string RightOOBReadMessage(int oob_distance) {
std::string RightOOBReadMessage(int oob_distance) {
return RightOOBErrorMessage(oob_distance, /*is_write*/false);
}
// FIXME: All tests that use this function should be turned into lit tests.
string LeftOOBErrorMessage(int oob_distance, bool is_write) {
std::string LeftOOBErrorMessage(int oob_distance, bool is_write) {
assert(oob_distance > 0);
char expected_str[100];
sprintf(expected_str,
@ -775,22 +775,22 @@ string LeftOOBErrorMessage(int oob_distance, bool is_write) {
is_write ? "WRITE" : "READ",
#endif
oob_distance);
return string(expected_str);
return std::string(expected_str);
}
string LeftOOBWriteMessage(int oob_distance) {
std::string LeftOOBWriteMessage(int oob_distance) {
return LeftOOBErrorMessage(oob_distance, /*is_write*/true);
}
string LeftOOBReadMessage(int oob_distance) {
std::string LeftOOBReadMessage(int oob_distance) {
return LeftOOBErrorMessage(oob_distance, /*is_write*/false);
}
string LeftOOBAccessMessage(int oob_distance) {
std::string LeftOOBAccessMessage(int oob_distance) {
assert(oob_distance > 0);
char expected_str[100];
sprintf(expected_str, "located %d bytes to the left", oob_distance);
return string(expected_str);
return std::string(expected_str);
}
char* MallocAndMemsetString(size_t size, char ch) {
@ -1199,11 +1199,11 @@ TEST(AddressSanitizer, AttributeNoSanitizeAddressTest) {
#if !defined(__ANDROID__) && \
!defined(__APPLE__) && \
!defined(_WIN32)
static string MismatchStr(const string &str) {
return string("AddressSanitizer: alloc-dealloc-mismatch \\(") + str;
static std::string MismatchStr(const std::string &str) {
return std::string("AddressSanitizer: alloc-dealloc-mismatch \\(") + str;
}
static string MismatchOrNewDeleteTypeStr(const string &mismatch_str) {
static std::string MismatchOrNewDeleteTypeStr(const std::string &mismatch_str) {
return "(" + MismatchStr(mismatch_str) +
")|(AddressSanitizer: new-delete-type-mismatch)";
}

View File

@ -73,13 +73,13 @@ NOINLINE void asan_write(T *a) {
*a = 0;
}
string RightOOBErrorMessage(int oob_distance, bool is_write);
string RightOOBWriteMessage(int oob_distance);
string RightOOBReadMessage(int oob_distance);
string LeftOOBErrorMessage(int oob_distance, bool is_write);
string LeftOOBWriteMessage(int oob_distance);
string LeftOOBReadMessage(int oob_distance);
string LeftOOBAccessMessage(int oob_distance);
std::string RightOOBErrorMessage(int oob_distance, bool is_write);
std::string RightOOBWriteMessage(int oob_distance);
std::string RightOOBReadMessage(int oob_distance);
std::string LeftOOBErrorMessage(int oob_distance, bool is_write);
std::string LeftOOBWriteMessage(int oob_distance);
std::string LeftOOBReadMessage(int oob_distance);
std::string LeftOOBAccessMessage(int oob_distance);
char* MallocAndMemsetString(size_t size, char ch);
char* MallocAndMemsetString(size_t size);