From d95ceff0925d5820e6ed8f1fbd188f8d9295e1cf Mon Sep 17 00:00:00 2001 From: Benjamin Kramer Date: Wed, 3 Oct 2012 18:54:36 +0000 Subject: [PATCH] Don't call getAsUnsignedInteger directly, it fails to compile if uint64_t is not "unsigned long long". while there add more test cases. llvm-svn: 165140 --- llvm/unittests/ADT/StringRefTest.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/llvm/unittests/ADT/StringRefTest.cpp b/llvm/unittests/ADT/StringRefTest.cpp index 59eed54f0342..e9c017babfc5 100644 --- a/llvm/unittests/ADT/StringRefTest.cpp +++ b/llvm/unittests/ADT/StringRefTest.cpp @@ -462,13 +462,17 @@ static const char* BadStrings[] = { , "123456789012345678901" // value way too large , "4t23v" // illegal decimal characters , "0x123W56" // illegal hex characters + , "0b2" // illegal bin characters + , "08" // illegal oct characters + , "0o8" // illegal oct characters + , "-123" // negative unsigned value }; TEST(StringRefTest, getAsUnsignedIntegerBadStrings) { uint64_t U64; for (size_t i = 0; i < array_lengthof(BadStrings); ++i) { - bool IsBadNumber = getAsUnsignedInteger(BadStrings[i], 0, U64); + bool IsBadNumber = StringRef(BadStrings[i]).getAsInteger(0, U64); ASSERT_TRUE(IsBadNumber); } }