summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
-rw-r--r--test/allocator_op.test.cpp7
-rw-r--r--test/option.test.cpp26
2 files changed, 9 insertions, 24 deletions
diff --git a/test/allocator_op.test.cpp b/test/allocator_op.test.cpp
index 33546de..5979c7d 100644
--- a/test/allocator_op.test.cpp
+++ b/test/allocator_op.test.cpp
@@ -15,6 +15,9 @@ BOOST_AUTO_TEST_CASE(allocator_should_succeed)
auto ptr = ocl::allocator<int>{}.construct_array<10>();
int* arr = ptr.get();
BOOST_TEST(arr != nullptr);
- *arr = 10;
- BOOST_TEST(*arr == 10);
+ for (auto i{0ul}; i < 10; ++i)
+ {
+ *(arr + i) = 10;
+ BOOST_TEST(*(arr + i) == 10);
+ }
}
diff --git a/test/option.test.cpp b/test/option.test.cpp
index 6751356..0e654b1 100644
--- a/test/option.test.cpp
+++ b/test/option.test.cpp
@@ -13,30 +13,12 @@
BOOST_AUTO_TEST_CASE(option_should_fail)
{
- bool ret = false;
- try
- {
- ocl::option opt(ocl::eval_false());
- opt.expect("");
- }
- catch (...)
- {
- ret = true;
- }
- BOOST_TEST(ret == true);
+ ocl::option opt(ocl::eval_false());
+ BOOST_CHECK_THROW(opt.expect(""), std::exception);
}
BOOST_AUTO_TEST_CASE(option_should_succeed)
{
- bool ret = true;
- try
- {
- ocl::option opt(ocl::eval_true());
- opt.expect("");
- }
- catch (...)
- {
- ret = false;
- }
- BOOST_TEST(ret == true);
+ ocl::option opt(ocl::eval_true());
+ BOOST_CHECK_NO_THROW(opt.expect(""));
}