+static test_return_t test_throw_success_TEST(void *)
+{
+ try {
+ _SUCCESS;
+ }
+ catch (const libtest::__success&)
+ {
+ return TEST_SUCCESS;
+ }
+ catch (...)
+ {
+ return TEST_FAILURE;
+ }
+
+ return TEST_FAILURE;
+}
+
+static test_return_t test_throw_skip_macro_TEST(void *)
+{
+ try {
+ SKIP_IF(true);
+ }
+ catch (const libtest::__skipped&)
+ {
+ return TEST_SUCCESS;
+ }
+ catch (...)
+ {
+ FAIL("SLIP_IF() failed to throw libtest::_skipped");
+ }
+
+ FAIL("SLIP_IF() failed to throw");
+
+ return TEST_FAILURE;
+}
+
+static test_return_t test_throw_skip_unless_macro_TEST(void *)
+{
+ try {
+ SKIP_UNLESS(false);
+ }
+ catch (const libtest::__skipped&)
+ {
+ return TEST_SUCCESS;
+ }
+ catch (...)
+ {
+ FAIL("SLIP_UNLESS() failed to throw libtest::_skipped");
+ }
+
+ FAIL("SLIP_UNLESS() failed to throw");
+
+ return TEST_FAILURE;
+}
+
+static test_return_t test_throw_skip_TEST(void *)
+{
+ try {
+ throw libtest::__skipped(LIBYATL_DEFAULT_PARAM, "basic test");
+ }
+ catch (const libtest::__skipped&)
+ {
+ return TEST_SUCCESS;
+ }
+ catch (...)
+ {
+ FAIL("SLIP_IF() failed to throw libtest::_skipped");
+ }
+
+ FAIL("SLIP_IF() failed to throw");
+
+ return TEST_FAILURE;
+}
+
+static test_return_t test_throw_fail_TEST(void *)
+{
+ try {
+ FAIL("test message!");
+ }
+ catch (const libtest::__failure& e)
+ {
+ std::string compare_message("test message!");
+ test_zero(compare_message.compare(e.what()));
+ return TEST_SUCCESS;
+ }
+ catch (...)
+ {
+ return TEST_FAILURE;
+ }
+
+ return TEST_FAILURE;
+}
+#pragma GCC diagnostic ignored "-Wstack-protector"
+
+#ifdef __clang__
+# pragma GCC diagnostic push
+# pragma GCC diagnostic ignored "-Wformat-security"
+#endif
+
+static test_return_t ASSERT_FALSE__TEST(void *)
+{
+ try {
+ ASSERT_FALSE(true);
+ }
+ catch (const libtest::__failure& e)
+ {
+ ASSERT_STREQ(e.what(), "Assertion '!true'");
+ return TEST_SUCCESS;
+ }
+ catch (...)
+ {
+ return TEST_FAILURE;
+ }
+
+ return TEST_FAILURE;
+}
+
+#ifdef __clang__
+# pragma GCC diagnostic pop
+#endif
+
+static test_return_t ASSERT_NEQ_FAIL_TEST(void *)
+{
+ try {
+ ASSERT_NEQ(1,1);
+ }
+ catch (const libtest::__failure& e)
+ {
+ ASSERT_STREQ(e.what(), "Assertion '1' == '1'");
+ return TEST_SUCCESS;
+ }
+ catch (...)
+ {
+ return TEST_FAILURE;
+ }
+
+ return TEST_FAILURE;
+}
+
+static test_return_t ASSERT_NEQ_TEST(void *)
+{
+ ASSERT_NEQ(1,0);
+
+ return TEST_SUCCESS;
+}
+
+static test_return_t ASSERT_FALSE_TEST(void *)
+{
+ try {
+ FAIL(__func__);
+ }
+ catch (const libtest::__failure& e)
+ {
+ ASSERT_STREQ(e.what(), __func__);
+ return TEST_SUCCESS;
+ }
+ catch (...)
+ {
+ return TEST_FAILURE;
+ }
+
+ return TEST_FAILURE;
+}
+