aboutsummaryrefslogtreecommitdiff
path: root/unittests
diff options
context:
space:
mode:
authorChandler Carruth <chandlerc@gmail.com>2010-07-13 17:28:05 +0000
committerChandler Carruth <chandlerc@gmail.com>2010-07-13 17:28:05 +0000
commit48b17fa5bebf46ecdbcb51ebab1c3d8b483afd3c (patch)
tree16dd60d4fe6f529077d3fe47a549b5151962cedd /unittests
parent9fea9c24fed5dad5854eebb1bc732b2549a93202 (diff)
Switch from EXPECT_EQ({true,false, ...) to the more canonical
EXPECT_{TRUE,FALSE}(...) macros. This also prevents suprious warnings about bool-to-pointer conversion that occurs withit EXPECT_EQ. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@108248 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'unittests')
-rw-r--r--unittests/ADT/APIntTest.cpp4
-rw-r--r--unittests/VMCore/PassManagerTest.cpp18
2 files changed, 11 insertions, 11 deletions
diff --git a/unittests/ADT/APIntTest.cpp b/unittests/ADT/APIntTest.cpp
index d08e86abaa..0cb79963f5 100644
--- a/unittests/ADT/APIntTest.cpp
+++ b/unittests/ADT/APIntTest.cpp
@@ -20,8 +20,8 @@ namespace {
TEST(APIntTest, ShiftLeftByZero) {
APInt One = APInt::getNullValue(65) + 1;
APInt Shl = One.shl(0);
- EXPECT_EQ(true, Shl[0]);
- EXPECT_EQ(false, Shl[1]);
+ EXPECT_TRUE(Shl[0]);
+ EXPECT_FALSE(Shl[1]);
}
TEST(APIntTest, i128_NegativeCount) {
diff --git a/unittests/VMCore/PassManagerTest.cpp b/unittests/VMCore/PassManagerTest.cpp
index 4b38910b11..cabfc44602 100644
--- a/unittests/VMCore/PassManagerTest.cpp
+++ b/unittests/VMCore/PassManagerTest.cpp
@@ -105,8 +105,8 @@ namespace llvm {
static bool finalized;
int allocated;
void run() {
- EXPECT_EQ(true, initialized);
- EXPECT_EQ(false, finalized);
+ EXPECT_TRUE(initialized);
+ EXPECT_FALSE(finalized);
EXPECT_EQ(0, allocated);
allocated++;
runc++;
@@ -115,8 +115,8 @@ namespace llvm {
static char ID;
static void finishedOK(int run) {
EXPECT_GT(runc, 0);
- EXPECT_EQ(true, initialized);
- EXPECT_EQ(true, finalized);
+ EXPECT_TRUE(initialized);
+ EXPECT_TRUE(finalized);
EXPECT_EQ(run, runc);
}
PassTestBase() : P(&ID), allocated(0) {
@@ -140,12 +140,12 @@ namespace llvm {
struct PassTest : public PassTestBase<P> {
public:
virtual bool doInitialization(T &t) {
- EXPECT_EQ(false, PassTestBase<P>::initialized);
+ EXPECT_FALSE(PassTestBase<P>::initialized);
PassTestBase<P>::initialized = true;
return false;
}
virtual bool doFinalization(T &t) {
- EXPECT_EQ(false, PassTestBase<P>::finalized);
+ EXPECT_FALSE(PassTestBase<P>::finalized);
PassTestBase<P>::finalized = true;
EXPECT_EQ(0, PassTestBase<P>::allocated);
return false;
@@ -180,7 +180,7 @@ namespace llvm {
public:
LPass() {
initcount = 0; fincount=0;
- EXPECT_EQ(false, initialized);
+ EXPECT_FALSE(initialized);
}
static void finishedOK(int run, int finalized) {
PassTestBase<LoopPass>::finishedOK(run);
@@ -222,7 +222,7 @@ namespace llvm {
fin = 0;
}
virtual bool doInitialization(Module &M) {
- EXPECT_EQ(false, initialized);
+ EXPECT_FALSE(initialized);
initialized = true;
return false;
}
@@ -240,7 +240,7 @@ namespace llvm {
return false;
}
virtual bool doFinalization(Module &M) {
- EXPECT_EQ(false, finalized);
+ EXPECT_FALSE(finalized);
finalized = true;
EXPECT_EQ(0, allocated);
return false;