aboutsummaryrefslogtreecommitdiffstats
path: root/test/utils
diff options
context:
space:
mode:
authorAlexander Sulfrian <alexander@sulfrian.net>2012-03-26 02:26:40 +0200
committerAlexander Sulfrian <alexander@sulfrian.net>2013-01-13 22:40:52 +0100
commita5e90892da7de8f10dae70b75f1fb51587eaf8db (patch)
tree42f9f092375e65a3b0228aed87865d9bedded2de /test/utils
parent9bd2b5f28805c9a5d0df28f6323b4c895e3fd9f4 (diff)
downloadusdx-a5e90892da7de8f10dae70b75f1fb51587eaf8db.tar.gz
usdx-a5e90892da7de8f10dae70b75f1fb51587eaf8db.tar.xz
usdx-a5e90892da7de8f10dae70b75f1fb51587eaf8db.zip
tests: changed CPPUNIT_ASSERT to CPPUNIT_ASSERT_EQUAL for better error msgs
Diffstat (limited to 'test/utils')
-rw-r--r--test/utils/image.cpp16
-rw-r--r--test/utils/point.cpp40
-rw-r--r--test/utils/rectangle.cpp24
3 files changed, 40 insertions, 40 deletions
diff --git a/test/utils/image.cpp b/test/utils/image.cpp
index c5f3bb48..f94e9afe 100644
--- a/test/utils/image.cpp
+++ b/test/utils/image.cpp
@@ -59,8 +59,8 @@ namespace usdx
const SDL_Surface *surface = img.get_surface();
log << log4cpp::Priority::INFO << "test.bmp: " <<
"w = " << surface->w << "; h = " << surface->h;
- CPPUNIT_ASSERT(40 == surface->w);
- CPPUNIT_ASSERT(30 == surface->h);
+ CPPUNIT_ASSERT_EQUAL(40, surface->w);
+ CPPUNIT_ASSERT_EQUAL(30, surface->h);
}
void testJpg()
@@ -69,8 +69,8 @@ namespace usdx
const SDL_Surface *surface = img.get_surface();
log << log4cpp::Priority::INFO << "test.jpg: " <<
"w = " << surface->w << "; h = " << surface->h;
- CPPUNIT_ASSERT(40 == surface->w);
- CPPUNIT_ASSERT(30 == surface->h);
+ CPPUNIT_ASSERT_EQUAL(40, surface->w);
+ CPPUNIT_ASSERT_EQUAL(30, surface->h);
}
void testPng()
@@ -79,8 +79,8 @@ namespace usdx
const SDL_Surface *surface = img.get_surface();
log << log4cpp::Priority::INFO << "test.png: " <<
"w = " << surface->w << "; h = " << surface->h;
- CPPUNIT_ASSERT(40 == surface->w);
- CPPUNIT_ASSERT(30 == surface->h);
+ CPPUNIT_ASSERT_EQUAL(40, surface->w);
+ CPPUNIT_ASSERT_EQUAL(30, surface->h);
}
void testGif()
@@ -89,8 +89,8 @@ namespace usdx
const SDL_Surface *surface = img.get_surface();
log << log4cpp::Priority::INFO << "test.gif: " <<
"w = " << surface->w << "; h = " << surface->h;
- CPPUNIT_ASSERT(40 == surface->w);
- CPPUNIT_ASSERT(30 == surface->h);
+ CPPUNIT_ASSERT_EQUAL(40, surface->w);
+ CPPUNIT_ASSERT_EQUAL(30, surface->h);
}
void testNotAnImage()
diff --git a/test/utils/point.cpp b/test/utils/point.cpp
index 64fa2216..6284ea2c 100644
--- a/test/utils/point.cpp
+++ b/test/utils/point.cpp
@@ -55,12 +55,12 @@ namespace usdx
Point<int> p1(100, 200), p2(50, 70);
Point<int> p3 = p1 + p2;
- CPPUNIT_ASSERT(p1.get_x() == 100);
- CPPUNIT_ASSERT(p1.get_y() == 200);
- CPPUNIT_ASSERT(p2.get_x() == 50);
- CPPUNIT_ASSERT(p2.get_y() == 70);
- CPPUNIT_ASSERT(p3.get_x() == 150);
- CPPUNIT_ASSERT(p3.get_y() == 270);
+ CPPUNIT_ASSERT_EQUAL(p1.get_x(), 100);
+ CPPUNIT_ASSERT_EQUAL(p1.get_y(), 200);
+ CPPUNIT_ASSERT_EQUAL(p2.get_x(), 50);
+ CPPUNIT_ASSERT_EQUAL(p2.get_y(), 70);
+ CPPUNIT_ASSERT_EQUAL(p3.get_x(), 150);
+ CPPUNIT_ASSERT_EQUAL(p3.get_y(), 270);
}
void testDiff()
@@ -68,12 +68,12 @@ namespace usdx
Point<int> p1(100, 200), p2(50, 70);
Point<int> p3 = p1 - p2;
- CPPUNIT_ASSERT(p1.get_x() == 100);
- CPPUNIT_ASSERT(p1.get_y() == 200);
- CPPUNIT_ASSERT(p2.get_x() == 50);
- CPPUNIT_ASSERT(p2.get_y() == 70);
- CPPUNIT_ASSERT(p3.get_x() == 50);
- CPPUNIT_ASSERT(p3.get_y() == 130);
+ CPPUNIT_ASSERT_EQUAL(p1.get_x(), 100);
+ CPPUNIT_ASSERT_EQUAL(p1.get_y(), 200);
+ CPPUNIT_ASSERT_EQUAL(p2.get_x(), 50);
+ CPPUNIT_ASSERT_EQUAL(p2.get_y(), 70);
+ CPPUNIT_ASSERT_EQUAL(p3.get_x(), 50);
+ CPPUNIT_ASSERT_EQUAL(p3.get_y(), 130);
}
void testCompoundSum()
@@ -81,10 +81,10 @@ namespace usdx
Point<int> p1(100, 200), p2(50, 70);
p1 += p2;
- CPPUNIT_ASSERT(p1.get_x() == 150);
- CPPUNIT_ASSERT(p1.get_y() == 270);
- CPPUNIT_ASSERT(p2.get_x() == 50);
- CPPUNIT_ASSERT(p2.get_y() == 70);
+ CPPUNIT_ASSERT_EQUAL(p1.get_x(), 150);
+ CPPUNIT_ASSERT_EQUAL(p1.get_y(), 270);
+ CPPUNIT_ASSERT_EQUAL(p2.get_x(), 50);
+ CPPUNIT_ASSERT_EQUAL(p2.get_y(), 70);
}
void testCompoundDiff()
@@ -92,10 +92,10 @@ namespace usdx
Point<int> p1(100, 200), p2(50, 70);
p1 -= p2;
- CPPUNIT_ASSERT(p1.get_x() == 50);
- CPPUNIT_ASSERT(p1.get_y() == 130);
- CPPUNIT_ASSERT(p2.get_x() == 50);
- CPPUNIT_ASSERT(p2.get_y() == 70);
+ CPPUNIT_ASSERT_EQUAL(p1.get_x(), 50);
+ CPPUNIT_ASSERT_EQUAL(p1.get_y(), 130);
+ CPPUNIT_ASSERT_EQUAL(p2.get_x(), 50);
+ CPPUNIT_ASSERT_EQUAL(p2.get_y(), 70);
}
};
diff --git a/test/utils/rectangle.cpp b/test/utils/rectangle.cpp
index 343d442f..faee50f9 100644
--- a/test/utils/rectangle.cpp
+++ b/test/utils/rectangle.cpp
@@ -54,10 +54,10 @@ namespace usdx
int coords[] = { 100, 150, 200, 250 };
Rectangle<int> rect(coords);
- CPPUNIT_ASSERT(rect.get_left() == 100);
- CPPUNIT_ASSERT(rect.get_top() == 150);
- CPPUNIT_ASSERT(rect.get_width() == 200);
- CPPUNIT_ASSERT(rect.get_height() == 250);
+ CPPUNIT_ASSERT_EQUAL(rect.get_left(), 100);
+ CPPUNIT_ASSERT_EQUAL(rect.get_top(), 150);
+ CPPUNIT_ASSERT_EQUAL(rect.get_width(), 200);
+ CPPUNIT_ASSERT_EQUAL(rect.get_height(), 250);
}
void testIntersectInner()
@@ -66,10 +66,10 @@ namespace usdx
Rectangle<int> inner(120, 170, 180, 200);
Rectangle<int> intersect = outer.intersect(inner);
- CPPUNIT_ASSERT(intersect.get_point1().get_x() == 120);
- CPPUNIT_ASSERT(intersect.get_point1().get_y() == 170);
- CPPUNIT_ASSERT(intersect.get_point2().get_x() == 180);
- CPPUNIT_ASSERT(intersect.get_point2().get_y() == 200);
+ CPPUNIT_ASSERT_EQUAL(intersect.get_point1().get_x(), 120);
+ CPPUNIT_ASSERT_EQUAL(intersect.get_point1().get_y(), 170);
+ CPPUNIT_ASSERT_EQUAL(intersect.get_point2().get_x(), 180);
+ CPPUNIT_ASSERT_EQUAL(intersect.get_point2().get_y(), 200);
}
void testIntersectOuter()
@@ -78,10 +78,10 @@ namespace usdx
Rectangle<int> inner(100, 150, 200, 250);
Rectangle<int> intersect = outer.intersect(inner);
- CPPUNIT_ASSERT(intersect.get_point1().get_x() == 120);
- CPPUNIT_ASSERT(intersect.get_point1().get_y() == 170);
- CPPUNIT_ASSERT(intersect.get_point2().get_x() == 180);
- CPPUNIT_ASSERT(intersect.get_point2().get_y() == 200);
+ CPPUNIT_ASSERT_EQUAL(intersect.get_point1().get_x(), 120);
+ CPPUNIT_ASSERT_EQUAL(intersect.get_point1().get_y(), 170);
+ CPPUNIT_ASSERT_EQUAL(intersect.get_point2().get_x(), 180);
+ CPPUNIT_ASSERT_EQUAL(intersect.get_point2().get_y(), 200);
}
};