"git@developer.sourcefind.cn:gaoqiong/migraphx.git" did not exist on "9e6d866d1bbfa42e8f574416b3a9e7f34a51b389"
Commit 8addb9d5 authored by Paul's avatar Paul
Browse files

Add more tests

parent e1a12af0
#include <migraph/program.hpp> #include <migraph/program.hpp>
#include <migraph/instruction.hpp>
#include <basic_ops.hpp> #include <basic_ops.hpp>
#include <test.hpp> #include <test.hpp>
...@@ -26,8 +27,32 @@ void out_of_order() ...@@ -26,8 +27,32 @@ void out_of_order()
EXPECT(bool{p.validate() == ins}); EXPECT(bool{p.validate() == ins});
} }
void incomplete_args()
{
migraph::program p;
auto one = p.add_literal(1);
auto two = p.add_literal(2);
auto ins = p.add_instruction(sum_op{}, one, two);
ins->clear_arguments();
EXPECT(bool{p.validate() == ins});
}
void invalid_args()
{
migraph::program p;
auto one = p.add_literal(1);
auto two = p.add_literal(2);
auto ins = p.add_instruction(sum_op{}, one, two);
ins->arguments.clear();
EXPECT(bool{p.validate() == p.begin()});
}
int main() int main()
{ {
simple_test(); simple_test();
out_of_order(); out_of_order();
incomplete_args();
invalid_args();
} }
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