Move from unittest-cpp to catch for unit testing. (#533)

Many thanks to @rianquinn. This should fix #495, #494 and #529.
This commit is contained in:
Neil MacIntosh
2017-07-13 13:53:56 -07:00
committed by GitHub
parent 1f87ef73f1
commit b2ee484334
24 changed files with 4315 additions and 4292 deletions
+18 -23
View File
@@ -14,7 +14,7 @@
//
///////////////////////////////////////////////////////////////////////////////
#include <UnitTest++/UnitTest++.h>
#include <catch/catch.hpp>
#include <gsl/gsl>
@@ -24,28 +24,23 @@
using namespace gsl;
SUITE(owner_tests)
void f(int* i) { *i += 1; }
TEST_CASE("basic_test")
{
void f(int* i) { *i += 1; }
TEST(basic_test)
{
owner<int*> p = new int(120);
CHECK(*p == 120);
f(p);
CHECK(*p == 121);
delete p;
}
TEST(check_pointer_constraint)
{
#ifdef CONFIRM_COMPILATION_ERRORS
{
owner<int> integerTest = 10;
owner<std::shared_ptr<int>> sharedPtrTest(new int(10));
}
#endif
}
owner<int*> p = new int(120);
CHECK(*p == 120);
f(p);
CHECK(*p == 121);
delete p;
}
int main(int, const char* []) { return UnitTest::RunAllTests(); }
TEST_CASE("check_pointer_constraint")
{
#ifdef CONFIRM_COMPILATION_ERRORS
{
owner<int> integerTest = 10;
owner<std::shared_ptr<int>> sharedPtrTest(new int(10));
}
#endif
}