diff options
author | Misha Brukman <brukman+llvm@gmail.com> | 2009-06-09 21:48:57 +0000 |
---|---|---|
committer | Misha Brukman <brukman+llvm@gmail.com> | 2009-06-09 21:48:57 +0000 |
commit | efee4ee46e5cc8f108391a33f2119891531989c6 (patch) | |
tree | 8b8ef23c44a88642ffde2d503960629001558e6b /unittests/ADT | |
parent | e3acf159d968b5a9db350203d8160a4d3c2d1a43 (diff) | |
download | external_llvm-efee4ee46e5cc8f108391a33f2119891531989c6.zip external_llvm-efee4ee46e5cc8f108391a33f2119891531989c6.tar.gz external_llvm-efee4ee46e5cc8f108391a33f2119891531989c6.tar.bz2 |
Reversed order of args in EXPECT_EQ() macros to be in the correct order:
EXPECT_EQ(expected, actual) . This will make error messages understandable as
it uses terms such as "expected" and "actual" based on the order of arguments.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@73150 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'unittests/ADT')
-rw-r--r-- | unittests/ADT/TripleTest.cpp | 140 |
1 files changed, 70 insertions, 70 deletions
diff --git a/unittests/ADT/TripleTest.cpp b/unittests/ADT/TripleTest.cpp index 771d1c7..dee09f4 100644 --- a/unittests/ADT/TripleTest.cpp +++ b/unittests/ADT/TripleTest.cpp @@ -18,120 +18,120 @@ TEST(TripleTest, BasicParsing) { Triple T; T = Triple(""); - EXPECT_EQ(T.getArchName(), ""); - EXPECT_EQ(T.getVendorName(), ""); - EXPECT_EQ(T.getOSName(), ""); - EXPECT_EQ(T.getEnvironmentName(), ""); + EXPECT_EQ("", T.getArchName()); + EXPECT_EQ("", T.getVendorName()); + EXPECT_EQ("", T.getOSName()); + EXPECT_EQ("", T.getEnvironmentName()); T = Triple("-"); - EXPECT_EQ(T.getArchName(), ""); - EXPECT_EQ(T.getVendorName(), ""); - EXPECT_EQ(T.getOSName(), ""); - EXPECT_EQ(T.getEnvironmentName(), ""); + EXPECT_EQ("", T.getArchName()); + EXPECT_EQ("", T.getVendorName()); + EXPECT_EQ("", T.getOSName()); + EXPECT_EQ("", T.getEnvironmentName()); T = Triple("--"); - EXPECT_EQ(T.getArchName(), ""); - EXPECT_EQ(T.getVendorName(), ""); - EXPECT_EQ(T.getOSName(), ""); - EXPECT_EQ(T.getEnvironmentName(), ""); + EXPECT_EQ("", T.getArchName()); + EXPECT_EQ("", T.getVendorName()); + EXPECT_EQ("", T.getOSName()); + EXPECT_EQ("", T.getEnvironmentName()); T = Triple("---"); - EXPECT_EQ(T.getArchName(), ""); - EXPECT_EQ(T.getVendorName(), ""); - EXPECT_EQ(T.getOSName(), ""); - EXPECT_EQ(T.getEnvironmentName(), ""); + EXPECT_EQ("", T.getArchName()); + EXPECT_EQ("", T.getVendorName()); + EXPECT_EQ("", T.getOSName()); + EXPECT_EQ("", T.getEnvironmentName()); T = Triple("----"); - EXPECT_EQ(T.getArchName(), ""); - EXPECT_EQ(T.getVendorName(), ""); - EXPECT_EQ(T.getOSName(), ""); - EXPECT_EQ(T.getEnvironmentName(), "-"); + EXPECT_EQ("", T.getArchName()); + EXPECT_EQ("", T.getVendorName()); + EXPECT_EQ("", T.getOSName()); + EXPECT_EQ("-", T.getEnvironmentName()); T = Triple("a"); - EXPECT_EQ(T.getArchName(), "a"); - EXPECT_EQ(T.getVendorName(), ""); - EXPECT_EQ(T.getOSName(), ""); - EXPECT_EQ(T.getEnvironmentName(), ""); + EXPECT_EQ("a", T.getArchName()); + EXPECT_EQ("", T.getVendorName()); + EXPECT_EQ("", T.getOSName()); + EXPECT_EQ("", T.getEnvironmentName()); T = Triple("a-b"); - EXPECT_EQ(T.getArchName(), "a"); - EXPECT_EQ(T.getVendorName(), "b"); - EXPECT_EQ(T.getOSName(), ""); - EXPECT_EQ(T.getEnvironmentName(), ""); + EXPECT_EQ("a", T.getArchName()); + EXPECT_EQ("b", T.getVendorName()); + EXPECT_EQ("", T.getOSName()); + EXPECT_EQ("", T.getEnvironmentName()); T = Triple("a-b-c"); - EXPECT_EQ(T.getArchName(), "a"); - EXPECT_EQ(T.getVendorName(), "b"); - EXPECT_EQ(T.getOSName(), "c"); - EXPECT_EQ(T.getEnvironmentName(), ""); + EXPECT_EQ("a", T.getArchName()); + EXPECT_EQ("b", T.getVendorName()); + EXPECT_EQ("c", T.getOSName()); + EXPECT_EQ("", T.getEnvironmentName()); T = Triple("a-b-c-d"); - EXPECT_EQ(T.getArchName(), "a"); - EXPECT_EQ(T.getVendorName(), "b"); - EXPECT_EQ(T.getOSName(), "c"); - EXPECT_EQ(T.getEnvironmentName(), "d"); + EXPECT_EQ("a", T.getArchName()); + EXPECT_EQ("b", T.getVendorName()); + EXPECT_EQ("c", T.getOSName()); + EXPECT_EQ("d", T.getEnvironmentName()); } TEST(TripleTest, ParsedIDs) { Triple T; T = Triple("i386-apple-darwin"); - EXPECT_EQ(T.getArch(), Triple::x86); - EXPECT_EQ(T.getVendor(), Triple::Apple); - EXPECT_EQ(T.getOS(), Triple::Darwin); + EXPECT_EQ(Triple::x86, T.getArch()); + EXPECT_EQ(Triple::Apple, T.getVendor()); + EXPECT_EQ(Triple::Darwin, T.getOS()); T = Triple("x86_64-pc-linux-gnu"); - EXPECT_EQ(T.getArch(), Triple::x86_64); - EXPECT_EQ(T.getVendor(), Triple::PC); - EXPECT_EQ(T.getOS(), Triple::Linux); + EXPECT_EQ(Triple::x86_64, T.getArch()); + EXPECT_EQ(Triple::PC, T.getVendor()); + EXPECT_EQ(Triple::Linux, T.getOS()); T = Triple("powerpc-dunno-notsure"); - EXPECT_EQ(T.getArch(), Triple::ppc); - EXPECT_EQ(T.getVendor(), Triple::UnknownVendor); - EXPECT_EQ(T.getOS(), Triple::UnknownOS); + EXPECT_EQ(Triple::ppc, T.getArch()); + EXPECT_EQ(Triple::UnknownVendor, T.getVendor()); + EXPECT_EQ(Triple::UnknownOS, T.getOS()); T = Triple("huh"); - EXPECT_EQ(T.getArch(), Triple::UnknownArch); + EXPECT_EQ(Triple::UnknownArch, T.getArch()); } TEST(TripleTest, MutateName) { Triple T; - EXPECT_EQ(T.getArch(), Triple::UnknownArch); - EXPECT_EQ(T.getVendor(), Triple::UnknownVendor); - EXPECT_EQ(T.getOS(), Triple::UnknownOS); + EXPECT_EQ(Triple::UnknownArch, T.getArch()); + EXPECT_EQ(Triple::UnknownVendor, T.getVendor()); + EXPECT_EQ(Triple::UnknownOS, T.getOS()); T.setArchName("i386"); - EXPECT_EQ(T.getArch(), Triple::x86); - EXPECT_EQ(T.getTriple(), "i386--"); + EXPECT_EQ(Triple::x86, T.getArch()); + EXPECT_EQ("i386--", T.getTriple()); T.setVendorName("pc"); - EXPECT_EQ(T.getArch(), Triple::x86); - EXPECT_EQ(T.getVendor(), Triple::PC); - EXPECT_EQ(T.getTriple(), "i386-pc-"); + EXPECT_EQ(Triple::x86, T.getArch()); + EXPECT_EQ(Triple::PC, T.getVendor()); + EXPECT_EQ("i386-pc-", T.getTriple()); T.setOSName("linux"); - EXPECT_EQ(T.getArch(), Triple::x86); - EXPECT_EQ(T.getVendor(), Triple::PC); - EXPECT_EQ(T.getOS(), Triple::Linux); - EXPECT_EQ(T.getTriple(), "i386-pc-linux"); + EXPECT_EQ(Triple::x86, T.getArch()); + EXPECT_EQ(Triple::PC, T.getVendor()); + EXPECT_EQ(Triple::Linux, T.getOS()); + EXPECT_EQ("i386-pc-linux", T.getTriple()); T.setEnvironmentName("gnu"); - EXPECT_EQ(T.getArch(), Triple::x86); - EXPECT_EQ(T.getVendor(), Triple::PC); - EXPECT_EQ(T.getOS(), Triple::Linux); - EXPECT_EQ(T.getTriple(), "i386-pc-linux-gnu"); + EXPECT_EQ(Triple::x86, T.getArch()); + EXPECT_EQ(Triple::PC, T.getVendor()); + EXPECT_EQ(Triple::Linux, T.getOS()); + EXPECT_EQ("i386-pc-linux-gnu", T.getTriple()); T.setOSName("freebsd"); - EXPECT_EQ(T.getArch(), Triple::x86); - EXPECT_EQ(T.getVendor(), Triple::PC); - EXPECT_EQ(T.getOS(), Triple::FreeBSD); - EXPECT_EQ(T.getTriple(), "i386-pc-freebsd-gnu"); + EXPECT_EQ(Triple::x86, T.getArch()); + EXPECT_EQ(Triple::PC, T.getVendor()); + EXPECT_EQ(Triple::FreeBSD, T.getOS()); + EXPECT_EQ("i386-pc-freebsd-gnu", T.getTriple()); T.setOSAndEnvironmentName("darwin"); - EXPECT_EQ(T.getArch(), Triple::x86); - EXPECT_EQ(T.getVendor(), Triple::PC); - EXPECT_EQ(T.getOS(), Triple::Darwin); - EXPECT_EQ(T.getTriple(), "i386-pc-darwin"); + EXPECT_EQ(Triple::x86, T.getArch()); + EXPECT_EQ(Triple::PC, T.getVendor()); + EXPECT_EQ(Triple::Darwin, T.getOS()); + EXPECT_EQ("i386-pc-darwin", T.getTriple()); } } |