@@ -535,6 +535,10 @@ TEST(ClangMove, DumpDecls) {
535
535
" namespace b {\n "
536
536
" class Move1 { public : void f(); };\n "
537
537
" void f() {}\n "
538
+ " enum E1 { Green };\n "
539
+ " enum class E2 { Red };\n "
540
+ " typedef int Int2;\n "
541
+ " using Int = int;\n "
538
542
" } // namespace b\n "
539
543
" } // namespace a\n " ;
540
544
const char TestCode[] = " #include \" foo.h\"\n " ;
@@ -545,22 +549,16 @@ TEST(ClangMove, DumpDecls) {
545
549
Spec.NewHeader = " new_foo.h" ;
546
550
Spec.NewCC = " new_foo.cc" ;
547
551
DeclarationReporter Reporter;
548
- std::vector <DeclarationReporter::DeclarationPair> ExpectedDeclarations = {
552
+ std::set <DeclarationReporter::DeclarationPair> ExpectedDeclarations = {
549
553
{" A" , " Class" }, {" B" , " Class" }, {" a::Move1" , " Class" },
550
554
{" a::f1" , " Function" }, {" a::f2" , " Function" }, {" a::b::Move1" , " Class" },
551
- {" a::b::f" , " Function" }};
555
+ {" a::b::f" , " Function" }, {" a::b::E1" , " Enum" }, {" a::b::E2" , " Enum" },
556
+ {" a::b::Int2" , " TypeAlias" }, {" a::b::Int" , " TypeAlias" } };
552
557
runClangMoveOnCode (Spec, TestHeader, TestCode, &Reporter);
553
- const auto & Results = Reporter.getDeclarationList ();
554
- auto ActualDeclIter = Results.begin ();
555
- auto ExpectedDeclIter = ExpectedDeclarations.begin ();
556
- while (ActualDeclIter != Results.end () &&
557
- ExpectedDeclIter != ExpectedDeclarations.end ()) {
558
- EXPECT_EQ (*ActualDeclIter, *ExpectedDeclIter);
559
- ++ActualDeclIter;
560
- ++ExpectedDeclIter;
561
- }
562
- ASSERT_TRUE (ActualDeclIter == Results.end ());
563
- ASSERT_TRUE (ExpectedDeclIter == ExpectedDeclarations.end ());
558
+ std::set<DeclarationReporter::DeclarationPair> Results;
559
+ for (const auto & DelPair : Reporter.getDeclarationList ())
560
+ Results.insert (DelPair);
561
+ EXPECT_EQ (ExpectedDeclarations, Results);
564
562
}
565
563
566
564
} // namespace
0 commit comments