Revert "Use standard C99 (and Qt) types for 64-bit integers"
[novacoin.git] / src / test / util_tests.cpp
index 350763e..9571c47 100644 (file)
@@ -2,12 +2,33 @@
 #include <boost/test/unit_test.hpp>
 #include <boost/foreach.hpp>
 
-#include "../util.h"
+#include "main.h"
+#include "wallet.h"
+#include "util.h"
 
 using namespace std;
 
 BOOST_AUTO_TEST_SUITE(util_tests)
 
+BOOST_AUTO_TEST_CASE(util_criticalsection)
+{
+    CCriticalSection cs;
+
+    do {
+        CRITICAL_BLOCK(cs)
+            break;
+
+        BOOST_ERROR("break was swallowed!");
+    } while(0);
+
+    do {
+        TRY_CRITICAL_BLOCK(cs)
+            break;
+
+        BOOST_ERROR("break was swallowed!");
+    } while(0);
+}
+
 BOOST_AUTO_TEST_CASE(util_MedianFilter)
 {    
     CMedianFilter<int> filter(5, 15);
@@ -117,7 +138,7 @@ BOOST_AUTO_TEST_CASE(util_GetArg)
     BOOST_CHECK_EQUAL(GetArg("strtest1", "default"), "string...");
     BOOST_CHECK_EQUAL(GetArg("strtest2", "default"), "default");
     BOOST_CHECK_EQUAL(GetArg("inttest1", -1), 12345);
-    BOOST_CHECK_EQUAL(GetArg("inttest2", -1), 81985529216486895);
+    BOOST_CHECK_EQUAL(GetArg("inttest2", -1), 81985529216486895LL);
     BOOST_CHECK_EQUAL(GetArg("inttest3", -1), -1);
     BOOST_CHECK_EQUAL(GetBoolArg("booltest1"), true);
     BOOST_CHECK_EQUAL(GetBoolArg("booltest2"), false);