summaryrefslogtreecommitdiff
path: root/Ix
diff options
context:
space:
mode:
authorMatt <MattPD@users.noreply.github.com>2015-07-23 15:45:21 +0200
committerMatt <MattPD@users.noreply.github.com>2015-07-23 15:45:21 +0200
commit97f37876f9283c316e464a136b027c6558295642 (patch)
tree7cd0007755e4384e4a5087711201a47ec10ad630 /Ix
parent37976da75a1e5aa4a224f10c5e640f5294762f36 (diff)
downloadRxCpp-97f37876f9283c316e464a136b027c6558295642.tar.gz
Update testbench.hpp
Diffstat (limited to 'Ix')
-rw-r--r--Ix/CPP/unittest/testbench.hpp15
1 files changed, 8 insertions, 7 deletions
diff --git a/Ix/CPP/unittest/testbench.hpp b/Ix/CPP/unittest/testbench.hpp
index 6dbb1c8..b2b8cfd 100644
--- a/Ix/CPP/unittest/testbench.hpp
+++ b/Ix/CPP/unittest/testbench.hpp
@@ -8,21 +8,22 @@
#include <sstream>
#include <utility>
#include <memory>
+#include <cstddef>
struct empty_testcase{ void run(){} const char* name(){return 0;} };
-template <size_t offset>
+template <std::size_t offset>
struct testcase : empty_testcase{};
-template <size_t begin, size_t end>
+template <std::size_t begin, std::size_t end>
struct testrange {
- void run(size_t& pass, size_t& fail)
+ void run(std::size_t& pass, std::size_t& fail)
{
using namespace std;
{ testcase<begin> a_case;
if (a_case.name()) {
- size_t p=0, f=0;
+ std::size_t p=0, f=0;
cout << "TEST: Running " << a_case.name() << endl;
try {
a_case.run();
@@ -35,15 +36,15 @@ struct testrange {
pass += p; fail += f;
}
}
- const size_t rem = (end-begin-1);
+ const std::size_t rem = (end-begin-1);
testrange<begin+1, begin+1+rem/2>().run(pass, fail);
testrange<begin+1+rem/2, end>().run(pass, fail);
}
};
-template <size_t begin>
+template <std::size_t begin>
struct testrange<begin,begin> {
- void run(size_t& pass, size_t& fail) {};
+ void run(std::size_t& pass, std::size_t& fail) {};
};
#define TEST(fun_name) \