]> git.lizzy.rs Git - dragonfireclient.git/blobdiff - src/unittest/test.h
Merge pull request #59 from PrairieAstronomer/readme_irrlicht_change
[dragonfireclient.git] / src / unittest / test.h
index 44b0cd02be5347eb00944fa8de84b5f86863243b..79ea0947101a3ca130c2eb7e8803de14e4cffc09 100644 (file)
@@ -71,7 +71,7 @@ class TestFailedException : public std::exception {
        }
 
 // Asserts the comparison specified by CMP is true, or fails the current unit test
-#define UASSERTCMP(T, CMP, actual, expected) do {                         \
+#define UASSERTCMP(T, CMP, actual, expected) {                            \
        T a = (actual);                                                       \
        T e = (expected);                                                     \
        if (!(a CMP e)) {                                                     \
@@ -80,16 +80,16 @@ class TestFailedException : public std::exception {
                        << #expected << std::endl                                     \
                        << "    at " << fs::GetFilenameFromPath(__FILE__) << ":"      \
                        << __LINE__ << std::endl                                      \
-                       << "    actual:   " << a << std::endl << "    expected: "     \
+                       << "    actual  : " << a << std::endl << "    expected: "     \
                        << e << std::endl;                                            \
                throw TestFailedException();                                      \
        }                                                                     \
-} while (0)
+}
 
 #define UASSERTEQ(T, actual, expected) UASSERTCMP(T, ==, actual, expected)
 
 // UASSERTs that the specified exception occurs
-#define EXCEPTION_CHECK(EType, code) do { \
+#define EXCEPTION_CHECK(EType, code) {    \
        bool exception_thrown = false;        \
        try {                                 \
                code;                             \
@@ -97,7 +97,7 @@ class TestFailedException : public std::exception {
                exception_thrown = true;          \
        }                                     \
        UASSERT(exception_thrown);            \
-} while (0)
+}
 
 class IGameDef;