Commit 3a84c350 authored by Ted Themistokleous's avatar Ted Themistokleous
Browse files

Clean up testcases to use test::throws()

parent 44de83e1
...@@ -1348,17 +1348,7 @@ TEST_CASE(div_zero_compile_trap_after_passes) ...@@ -1348,17 +1348,7 @@ TEST_CASE(div_zero_compile_trap_after_passes)
mm->add_instruction(migraphx::make_op("div"), x, zero); mm->add_instruction(migraphx::make_op("div"), x, zero);
run_pass(*mm); run_pass(*mm);
bool result = false; EXPECT(test::throws([&] { p.compile(migraphx::ref::target{}); }));
try
{
p.compile(migraphx::ref::target{});
}
catch(const std::runtime_error& e)
{
(void)e;
result = true;
}
EXPECT(result);
} }
TEST_CASE(div_zero_compile_trap_long_program_after_passes) TEST_CASE(div_zero_compile_trap_long_program_after_passes)
...@@ -1375,18 +1365,7 @@ TEST_CASE(div_zero_compile_trap_long_program_after_passes) ...@@ -1375,18 +1365,7 @@ TEST_CASE(div_zero_compile_trap_long_program_after_passes)
mm->add_instruction(migraphx::make_op("sub"), y, add); mm->add_instruction(migraphx::make_op("sub"), y, add);
run_pass(*mm); run_pass(*mm);
EXPECT(test::throws([&] { p.compile(migraphx::ref::target{}); }));
bool result = false;
try
{
p.compile(migraphx::ref::target{});
}
catch(const std::runtime_error& e)
{
(void)e;
result = true;
}
EXPECT(result);
} }
TEST_CASE(div_zero_eval_fails) TEST_CASE(div_zero_eval_fails)
...@@ -1403,18 +1382,7 @@ TEST_CASE(div_zero_eval_fails) ...@@ -1403,18 +1382,7 @@ TEST_CASE(div_zero_eval_fails)
mm->add_instruction(migraphx::make_op("sub"), y, add); mm->add_instruction(migraphx::make_op("sub"), y, add);
run_pass(*mm); run_pass(*mm);
EXPECT(test::throws([&] { p.eval({}).back(); }));
bool result = false;
try
{
p.eval({}).back();
}
catch(const std::runtime_error& e)
{
(void)e;
result = true;
}
EXPECT(result);
} }
TEST_CASE(div_zero_compute_shape_fails) TEST_CASE(div_zero_compute_shape_fails)
...@@ -1426,18 +1394,7 @@ TEST_CASE(div_zero_compute_shape_fails) ...@@ -1426,18 +1394,7 @@ TEST_CASE(div_zero_compute_shape_fails)
auto div0 = mm->add_divzero({x, zero}, {migraphx::shape::float_type, {1}}); auto div0 = mm->add_divzero({x, zero}, {migraphx::shape::float_type, {1}});
run_pass(*mm); run_pass(*mm);
EXPECT(test::throws([&] { div0->recompute_shape(); }));
bool result = false;
try
{
div0->recompute_shape();
}
catch(const std::runtime_error& e)
{
(void)e;
result = true;
}
EXPECT(result);
} }
TEST_CASE(elu_test) TEST_CASE(elu_test)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment