r222664 - Unbreaking the MSVC 2012 build; however, these tests still fail on Windows.

Aaron Ballman aaron at aaronballman.com
Mon Nov 24 09:22:33 PST 2014


Author: aaronballman
Date: Mon Nov 24 11:22:32 2014
New Revision: 222664

URL: http://llvm.org/viewvc/llvm-project?rev=222664&view=rev
Log:
Unbreaking the MSVC 2012 build; however, these tests still fail on Windows.

Modified:
    cfe/trunk/unittests/ASTMatchers/ASTMatchersTest.cpp

Modified: cfe/trunk/unittests/ASTMatchers/ASTMatchersTest.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/unittests/ASTMatchers/ASTMatchersTest.cpp?rev=222664&r1=222663&r2=222664&view=diff
==============================================================================
--- cfe/trunk/unittests/ASTMatchers/ASTMatchersTest.cpp (original)
+++ cfe/trunk/unittests/ASTMatchers/ASTMatchersTest.cpp Mon Nov 24 11:22:32 2014
@@ -4634,36 +4634,43 @@ TEST(Matcher, IsExpansionInMainFileMatch
   EXPECT_TRUE(matches("class X {};",
                       recordDecl(hasName("X"), isExpansionInMainFile())));
   EXPECT_TRUE(notMatches("", recordDecl(isExpansionInMainFile())));
+  FileContentMappings M;
+  M.push_back(std::make_pair("/other", "class X {};"));
   EXPECT_TRUE(matchesConditionally("#include <other>\n",
                                    recordDecl(isExpansionInMainFile()), false,
-                                   "-isystem/", {{"/other", "class X {};"}}));
+                                   "-isystem/", M));
 }
 
 TEST(Matcher, IsExpansionInSystemHeader) {
+  FileContentMappings M;
+  M.push_back(std::make_pair("/other", "class X {};"));
   EXPECT_TRUE(matchesConditionally(
       "#include \"other\"\n", recordDecl(isExpansionInSystemHeader()), true,
-      "-isystem/", {{"/other", "class X {};"}}));
+      "-isystem/", M));
   EXPECT_TRUE(matchesConditionally("#include \"other\"\n",
                                    recordDecl(isExpansionInSystemHeader()),
-                                   false, "-I/", {{"/other", "class X {};"}}));
+                                   false, "-I/", M));
   EXPECT_TRUE(notMatches("class X {};",
                          recordDecl(isExpansionInSystemHeader())));
   EXPECT_TRUE(notMatches("", recordDecl(isExpansionInSystemHeader())));
 }
 
 TEST(Matcher, IsExpansionInFileMatching) {
+  FileContentMappings M;
+  M.push_back(std::make_pair("/foo", "class A {};"));
+  M.push_back(std::make_pair("/bar", "class B {};"));
   EXPECT_TRUE(matchesConditionally(
       "#include <foo>\n"
       "#include <bar>\n"
       "class X {};",
       recordDecl(isExpansionInFileMatching("b.*"), hasName("B")), true,
-      "-isystem/", {{"/foo", "class A {};"}, {"/bar", "class B {};"}}));
+      "-isystem/", M));
   EXPECT_TRUE(matchesConditionally(
       "#include <foo>\n"
       "#include <bar>\n"
       "class X {};",
       recordDecl(isExpansionInFileMatching("f.*"), hasName("X")), false,
-      "-isystem/", {{"/foo", "class A {};"}, {"/bar", "class B {};"}}));
+      "-isystem/", M));
 }
 
 } // end namespace ast_matchers





More information about the cfe-commits mailing list