about summary refs log tree commit diff homepage
path: root/unittests/Expr/ExprTest.cpp
diff options
context:
space:
mode:
authorDaniel Dunbar <daniel@zuster.org>2009-06-03 15:40:42 +0000
committerDaniel Dunbar <daniel@zuster.org>2009-06-03 15:40:42 +0000
commit32461e170b16d2f6cbcd04830bf68ce2a6372db5 (patch)
tree59c8813624c9072d2ecd14526658d6751e5a9674 /unittests/Expr/ExprTest.cpp
parentd55171601a0537506ddd05d37a1dabe372454a6d (diff)
downloadklee-32461e170b16d2f6cbcd04830bf68ce2a6372db5.tar.gz
Kill off specialized ref<> forwarding methods, in the interest of making it a
more standard reference counting wrapper.
 - The only interesting changes here are in Ref.h, everything else is just
   updating foo.method to use foo->method instead.


git-svn-id: https://llvm.org/svn/llvm-project/klee/trunk@72777 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'unittests/Expr/ExprTest.cpp')
-rw-r--r--unittests/Expr/ExprTest.cpp56
1 files changed, 28 insertions, 28 deletions
diff --git a/unittests/Expr/ExprTest.cpp b/unittests/Expr/ExprTest.cpp
index 72b37ab2..84179661 100644
--- a/unittests/Expr/ExprTest.cpp
+++ b/unittests/Expr/ExprTest.cpp
@@ -35,48 +35,48 @@ TEST(ExprTest, ConcatExtract) {
   ref<Expr> c100 = getConstant(100, 8);
 
   ref<Expr> concat1 = ConcatExpr::create4(read8, read8, c100, read8_2);
-  EXPECT_EQ(2U, concat1.getNumKids());
-  EXPECT_EQ(2U, concat1.getKid(1).getNumKids());
-  EXPECT_EQ(2U, concat1.getKid(1).getKid(1).getNumKids());
+  EXPECT_EQ(2U, concat1->getNumKids());
+  EXPECT_EQ(2U, concat1->getKid(1)->getNumKids());
+  EXPECT_EQ(2U, concat1->getKid(1)->getKid(1)->getNumKids());
 
   ref<Expr> extract1 = ExtractExpr::create(concat1, 8, 16);
-  EXPECT_EQ(Expr::Concat, extract1.getKind());
-  EXPECT_EQ(read8, extract1.getKid(0));
-  EXPECT_EQ(c100, extract1.getKid(1));
+  EXPECT_EQ(Expr::Concat, extract1->getKind());
+  EXPECT_EQ(read8, extract1->getKid(0));
+  EXPECT_EQ(c100, extract1->getKid(1));
 
   ref<Expr> extract2 = ExtractExpr::create(concat1, 6, 26);
-  EXPECT_EQ( Expr::Concat, extract2.getKind());
-  EXPECT_EQ( read8, extract2.getKid(0));
-  EXPECT_EQ( Expr::Concat, extract2.getKid(1).getKind());
-  EXPECT_EQ( read8, extract2.getKid(1).getKid(0));
-  EXPECT_EQ( Expr::Concat, extract2.getKid(1).getKid(1).getKind());
-  EXPECT_EQ( c100, extract2.getKid(1).getKid(1).getKid(0));
-  EXPECT_EQ( Expr::Extract, extract2.getKid(1).getKid(1).getKid(1).getKind());
+  EXPECT_EQ( Expr::Concat, extract2->getKind());
+  EXPECT_EQ( read8, extract2->getKid(0));
+  EXPECT_EQ( Expr::Concat, extract2->getKid(1)->getKind());
+  EXPECT_EQ( read8, extract2->getKid(1)->getKid(0));
+  EXPECT_EQ( Expr::Concat, extract2->getKid(1)->getKid(1)->getKind());
+  EXPECT_EQ( c100, extract2->getKid(1)->getKid(1)->getKid(0));
+  EXPECT_EQ( Expr::Extract, extract2->getKid(1)->getKid(1)->getKid(1)->getKind());
   
   ref<Expr> extract3 = ExtractExpr::create(concat1, 24, 1);
-  EXPECT_EQ(Expr::Extract, extract3.getKind());
+  EXPECT_EQ(Expr::Extract, extract3->getKind());
 
   ref<Expr> extract4 = ExtractExpr::create(concat1, 27, 2);
-  EXPECT_EQ(Expr::Extract, extract4.getKind());
+  EXPECT_EQ(Expr::Extract, extract4->getKind());
   const ExtractExpr* tmp = dyn_ref_cast<ExtractExpr>(extract4);
   EXPECT_EQ(3U, tmp->offset);
   EXPECT_EQ(2U, tmp->getWidth());
 
   ref<Expr> extract5 = ExtractExpr::create(concat1, 17, 5);
-  EXPECT_EQ(Expr::Extract, extract5.getKind());
+  EXPECT_EQ(Expr::Extract, extract5->getKind());
 
   ref<Expr> extract6 = ExtractExpr::create(concat1, 3, 26);
-  EXPECT_EQ(Expr::Concat, extract6.getKind());
-  EXPECT_EQ(Expr::Extract, extract6.getKid(0).getKind());
-  EXPECT_EQ(Expr::Concat, extract6.getKid(1).getKind());
-  EXPECT_EQ(read8, extract6.getKid(1).getKid(0));
-  EXPECT_EQ(Expr::Concat, extract6.getKid(1).getKid(1).getKind());
-  EXPECT_EQ(c100, extract6.getKid(1).getKid(1).getKid(0));
-  EXPECT_EQ(Expr::Extract, extract6.getKid(1).getKid(1).getKid(1).getKind());
+  EXPECT_EQ(Expr::Concat, extract6->getKind());
+  EXPECT_EQ(Expr::Extract, extract6->getKid(0)->getKind());
+  EXPECT_EQ(Expr::Concat, extract6->getKid(1)->getKind());
+  EXPECT_EQ(read8, extract6->getKid(1)->getKid(0));
+  EXPECT_EQ(Expr::Concat, extract6->getKid(1)->getKid(1)->getKind());
+  EXPECT_EQ(c100, extract6->getKid(1)->getKid(1)->getKid(0));
+  EXPECT_EQ(Expr::Extract, extract6->getKid(1)->getKid(1)->getKid(1)->getKind());
 
   ref<Expr> concat10 = ConcatExpr::create4(read8, c100, c100, read8);    
   ref<Expr> extract10 = ExtractExpr::create(concat10, 8, 16);
-  EXPECT_EQ(Expr::Constant, extract10.getKind());
+  EXPECT_EQ(Expr::Constant, extract10->getKind());
 }
 
 TEST(ExprTest, ExtractConcat) {
@@ -97,16 +97,16 @@ TEST(ExprTest, ExtractConcat) {
 			 read8_2,
 			 extract3, extract4, extract5 };
   ref<Expr> concat1 = ConcatExpr::createN(6, kids1);
-  EXPECT_EQ(29U, concat1.getWidth());
+  EXPECT_EQ(29U, concat1->getWidth());
   
   ref<Expr> extract6 = ExtractExpr::create(read8_2, 2, 5);
   ref<Expr> extract7 = ExtractExpr::create(read8_2, 1, 1);
   
   ref<Expr> kids2[3] = { extract1, extract6, extract7 };
   ref<Expr> concat2 = ConcatExpr::createN(3, kids2);
-  EXPECT_EQ(10U, concat2.getWidth());
-  EXPECT_EQ(Expr::Extract, concat2.getKid(0).getKind());
-  EXPECT_EQ(Expr::Extract, concat2.getKid(1).getKind());
+  EXPECT_EQ(10U, concat2->getWidth());
+  EXPECT_EQ(Expr::Extract, concat2->getKid(0)->getKind());
+  EXPECT_EQ(Expr::Extract, concat2->getKid(1)->getKind());
 }
 
 }