diff options
author | Devang Patel <dpatel@apple.com> | 2009-07-23 02:00:51 +0000 |
---|---|---|
committer | Devang Patel <dpatel@apple.com> | 2009-07-23 02:00:51 +0000 |
commit | 2f9c3b002d3cb465fefc5f4b2535ca994c5e9283 (patch) | |
tree | 05f0d304147132f0a0c1ac6da9be0895790ffa32 /unittests/VMCore | |
parent | 3091719b90aca9f7336d4ca26ef3a0d48c4a06d2 (diff) | |
download | external_llvm-2f9c3b002d3cb465fefc5f4b2535ca994c5e9283.zip external_llvm-2f9c3b002d3cb465fefc5f4b2535ca994c5e9283.tar.gz external_llvm-2f9c3b002d3cb465fefc5f4b2535ca994c5e9283.tar.bz2 |
MDString
- Rename member function size(). New name is length().
- Store string beginning and length. Earlier it used to store string end.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@76841 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'unittests/VMCore')
-rw-r--r-- | unittests/VMCore/MetadataTest.cpp | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/unittests/VMCore/MetadataTest.cpp b/unittests/VMCore/MetadataTest.cpp index 732719e..d612808 100644 --- a/unittests/VMCore/MetadataTest.cpp +++ b/unittests/VMCore/MetadataTest.cpp @@ -23,9 +23,9 @@ namespace { // MDString objects, even with the same string pointer and nulls in the string. TEST(MDStringTest, CreateDifferent) { char x[3] = { 'f', 0, 'A' }; - MDString *s1 = getGlobalContext().getMDString(&x[0], &x[3]); + MDString *s1 = getGlobalContext().getMDString(&x[0], 3); x[2] = 'B'; - MDString *s2 = getGlobalContext().getMDString(&x[0], &x[3]); + MDString *s2 = getGlobalContext().getMDString(&x[0], 3); EXPECT_NE(s1, s2); } @@ -35,8 +35,8 @@ TEST(MDStringTest, CreateSame) { char x[4] = { 'a', 'b', 'c', 'X' }; char y[4] = { 'a', 'b', 'c', 'Y' }; - MDString *s1 = getGlobalContext().getMDString(&x[0], &x[3]); - MDString *s2 = getGlobalContext().getMDString(&y[0], &y[3]); + MDString *s1 = getGlobalContext().getMDString(&x[0], 3); + MDString *s2 = getGlobalContext().getMDString(&y[0], 3); EXPECT_EQ(s1, s2); } @@ -44,7 +44,7 @@ TEST(MDStringTest, CreateSame) { TEST(MDStringTest, PrintingSimple) { char *str = new char[13]; strncpy(str, "testing 1 2 3", 13); - MDString *s = getGlobalContext().getMDString(str, str+13); + MDString *s = getGlobalContext().getMDString(str, 13); strncpy(str, "aaaaaaaaaaaaa", 13); delete[] str; @@ -56,7 +56,7 @@ TEST(MDStringTest, PrintingSimple) { // Test printing of MDString with non-printable characters. TEST(MDStringTest, PrintingComplex) { char str[5] = {0, '\n', '"', '\\', -1}; - MDString *s = getGlobalContext().getMDString(str+0, str+5); + MDString *s = getGlobalContext().getMDString(str+0, 5); std::ostringstream oss; s->print(oss); EXPECT_STREQ("metadata !\"\\00\\0A\\22\\5C\\FF\"", oss.str().c_str()); @@ -67,8 +67,8 @@ TEST(MDNodeTest, Simple) { char x[3] = { 'a', 'b', 'c' }; char y[3] = { '1', '2', '3' }; - MDString *s1 = getGlobalContext().getMDString(&x[0], &x[3]); - MDString *s2 = getGlobalContext().getMDString(&y[0], &y[3]); + MDString *s1 = getGlobalContext().getMDString(&x[0], 3); + MDString *s2 = getGlobalContext().getMDString(&y[0], 3); ConstantInt *CI = getGlobalContext().getConstantInt(APInt(8, 0)); std::vector<Value *> V; |