diff options
author | Aaron Ballman <aaron@aaronballman.com> | 2014-11-24 17:22:32 +0000 |
---|---|---|
committer | Aaron Ballman <aaron@aaronballman.com> | 2014-11-24 17:22:32 +0000 |
commit | 2b231aac52c8c0d2c349e2e6a4d8a40cd234ac33 (patch) | |
tree | 729456c441dc238fc6cd80c3eaa8740f043f3a10 /unittests | |
parent | 64b76d50f508dca4cf748da91e44c6ef271ee4b1 (diff) |
Unbreaking the MSVC 2012 build; however, these tests still fail on Windows.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@222664 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'unittests')
-rw-r--r-- | unittests/ASTMatchers/ASTMatchersTest.cpp | 17 |
1 files changed, 12 insertions, 5 deletions
diff --git a/unittests/ASTMatchers/ASTMatchersTest.cpp b/unittests/ASTMatchers/ASTMatchersTest.cpp index dcca04fa97..ba66a2da9e 100644 --- a/unittests/ASTMatchers/ASTMatchersTest.cpp +++ b/unittests/ASTMatchers/ASTMatchersTest.cpp @@ -4634,36 +4634,43 @@ TEST(Matcher, IsExpansionInMainFileMatcher) { 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 |