diff options
author | Hans Wennborg <hans@hanshq.net> | 2013-09-11 01:59:32 +0000 |
---|---|---|
committer | Hans Wennborg <hans@hanshq.net> | 2013-09-11 01:59:32 +0000 |
commit | 90c782a9ca9bc9325e9a1f075890311c15dfeb0e (patch) | |
tree | 04d5d4e4616e94efbde0dc511e09d2f1b83ef0e7 /unittests/Support | |
parent | abaa85d88d13f6efa99c61d206155678ccd5f118 (diff) | |
download | external_llvm-90c782a9ca9bc9325e9a1f075890311c15dfeb0e.zip external_llvm-90c782a9ca9bc9325e9a1f075890311c15dfeb0e.tar.gz external_llvm-90c782a9ca9bc9325e9a1f075890311c15dfeb0e.tar.bz2 |
Revert "YAMLIO: Fix string quoting logic." (r190469)
It was turning the buildbots red.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@190480 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'unittests/Support')
-rw-r--r-- | unittests/Support/YAMLIOTest.cpp | 57 |
1 files changed, 0 insertions, 57 deletions
diff --git a/unittests/Support/YAMLIOTest.cpp b/unittests/Support/YAMLIOTest.cpp index 8ae05f4..43d8397 100644 --- a/unittests/Support/YAMLIOTest.cpp +++ b/unittests/Support/YAMLIOTest.cpp @@ -273,64 +273,7 @@ TEST(YAMLIO, TestReadWriteBuiltInTypes) { } } -struct StringTypes { - llvm::StringRef str1; - llvm::StringRef str2; - llvm::StringRef str3; - llvm::StringRef str4; - llvm::StringRef str5; -}; -namespace llvm { -namespace yaml { - template <> - struct MappingTraits<StringTypes> { - static void mapping(IO &io, StringTypes& st) { - io.mapRequired("str1", st.str1); - io.mapRequired("str2", st.str2); - io.mapRequired("str3", st.str3); - io.mapRequired("str4", st.str4); - io.mapRequired("str5", st.str5); - } - }; -} -} - -TEST(YAMLIO, TestReadWriteStringTypes) { - std::string intermediate; - { - StringTypes map; - map.str1 = "'aaa"; - map.str2 = "\"bbb"; - map.str3 = "`ccc"; - map.str4 = "@ddd"; - map.str5 = ""; - - llvm::raw_string_ostream ostr(intermediate); - Output yout(ostr); - yout << map; - } - - llvm::StringRef flowOut(intermediate); - EXPECT_NE(llvm::StringRef::npos, flowOut.find("'''aaa")); - EXPECT_NE(llvm::StringRef::npos, flowOut.find("'\"bbb'")); - EXPECT_NE(llvm::StringRef::npos, flowOut.find("'`ccc'")); - EXPECT_NE(llvm::StringRef::npos, flowOut.find("'@ddd'")); - EXPECT_NE(llvm::StringRef::npos, flowOut.find("''\n")); - - { - Input yin(intermediate); - StringTypes map; - yin >> map; - - EXPECT_FALSE(yin.error()); - EXPECT_TRUE(map.str1.equals("'aaa")); - EXPECT_TRUE(map.str2.equals("\"bbb")); - EXPECT_TRUE(map.str3.equals("`ccc")); - EXPECT_TRUE(map.str4.equals("@ddd")); - EXPECT_TRUE(map.str5.equals("")); - } -} //===----------------------------------------------------------------------===// // Test ScalarEnumerationTraits |