aboutsummaryrefslogtreecommitdiff
path: root/llvm/unittests/ADT/StringMapTest.cpp
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2011-07-14 18:31:43 +0000
committerChris Lattner <sabre@nondot.org>2011-07-14 18:31:43 +0000
commit7c37b1cf5176eeb0fd11c90f9cabad12ce01a102 (patch)
treec1860491679f9f644059dcdd9d4e5af48e34a7be /llvm/unittests/ADT/StringMapTest.cpp
parentd386df4dbd02154582d03a8ad58ac79db5ff5f16 (diff)
downloadllvm-7c37b1cf5176eeb0fd11c90f9cabad12ce01a102.zip
llvm-7c37b1cf5176eeb0fd11c90f9cabad12ce01a102.tar.gz
llvm-7c37b1cf5176eeb0fd11c90f9cabad12ce01a102.tar.bz2
The key of a StringMap can contain nul's in it, so having first() return
const char* doesn't make sense. Have it return StringRef instead. llvm-svn: 135167
Diffstat (limited to 'llvm/unittests/ADT/StringMapTest.cpp')
-rw-r--r--llvm/unittests/ADT/StringMapTest.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/llvm/unittests/ADT/StringMapTest.cpp b/llvm/unittests/ADT/StringMapTest.cpp
index ea91348..2ae5820 100644
--- a/llvm/unittests/ADT/StringMapTest.cpp
+++ b/llvm/unittests/ADT/StringMapTest.cpp
@@ -51,7 +51,7 @@ protected:
// Iterator tests
StringMap<uint32_t>::iterator it = testMap.begin();
- EXPECT_STREQ(testKey, it->first());
+ EXPECT_STREQ(testKey, it->first().data());
EXPECT_EQ(testValue, it->second);
++it;
EXPECT_TRUE(it == testMap.end());
@@ -157,7 +157,7 @@ TEST_F(StringMapTest, IterationTest) {
it != testMap.end(); ++it) {
std::stringstream ss;
ss << "key_" << it->second;
- ASSERT_STREQ(ss.str().c_str(), it->first());
+ ASSERT_STREQ(ss.str().c_str(), it->first().data());
visited[it->second] = true;
}
@@ -189,7 +189,7 @@ TEST_F(StringMapTest, StringMapEntryTest) {
StringMap<uint32_t>::value_type* entry =
StringMap<uint32_t>::value_type::Create(
testKeyFirst, testKeyFirst + testKeyLength, 1u);
- EXPECT_STREQ(testKey, entry->first());
+ EXPECT_STREQ(testKey, entry->first().data());
EXPECT_EQ(1u, entry->second);
free(entry);
}