Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
gaoqiong
MIGraphX
Commits
3a84c350
Commit
3a84c350
authored
Jul 27, 2022
by
Ted Themistokleous
Browse files
Clean up testcases to use test::throws()
parent
44de83e1
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
47 deletions
+4
-47
test/ref_ops_test.cpp
test/ref_ops_test.cpp
+4
-47
No files found.
test/ref_ops_test.cpp
View file @
3a84c350
...
@@ -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
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment