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
9ba13b7f
Commit
9ba13b7f
authored
Apr 16, 2019
by
Khalique
Browse files
added test conditions
parent
a7facf9d
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
13 additions
and
3 deletions
+13
-3
src/include/migraphx/ranges.hpp
src/include/migraphx/ranges.hpp
+1
-1
test/print_graph_test.cpp
test/print_graph_test.cpp
+12
-2
No files found.
src/include/migraphx/ranges.hpp
View file @
9ba13b7f
...
@@ -12,7 +12,7 @@ inline namespace MIGRAPHX_INLINE_NS {
...
@@ -12,7 +12,7 @@ inline namespace MIGRAPHX_INLINE_NS {
namespace
detail
{
namespace
detail
{
template
<
class
String
,
class
T
>
template
<
class
String
,
class
T
>
auto
generic_find_impl
(
rank
<
2
>
,
String
&&
s
,
const
T
&
x
)
->
decltype
(
s
.
begin
()
+
s
.
find
(
x
)
,
s
.
npos
)
auto
generic_find_impl
(
rank
<
2
>
,
String
&&
s
,
const
T
&
x
)
->
decltype
(
s
.
npos
,
s
.
begin
()
+
s
.
find
(
x
))
{
{
auto
index
=
s
.
find
(
x
);
auto
index
=
s
.
find
(
x
);
if
(
index
==
s
.
npos
)
if
(
index
==
s
.
npos
)
...
...
test/print_graph_test.cpp
View file @
9ba13b7f
...
@@ -24,8 +24,18 @@ TEST_CASE(basic_graph_test)
...
@@ -24,8 +24,18 @@ TEST_CASE(basic_graph_test)
std
::
stringstream
ss
;
std
::
stringstream
ss
;
p
.
print_graph
(
ss
);
p
.
print_graph
(
ss
);
std
::
string
test
=
ss
.
str
();
std
::
string
test
=
ss
.
str
();
std
::
cout
<<
test
<<
std
::
endl
;
EXPECT
(
migraphx
::
contains
(
test
,
"digraph"
));
EXPECT
(
test
.
find
(
"[label=@literal]"
)
!=
std
::
string
::
npos
);
EXPECT
(
migraphx
::
contains
(
test
,
"rankdir=LR"
));
EXPECT
(
migraphx
::
contains
(
test
,
"
\"
@0
\"
[label=
\"
@literal
\"
]"
));
EXPECT
(
migraphx
::
contains
(
test
,
"
\"
y
\"
[label=
\"
@param:y
\"
]"
));
EXPECT
(
migraphx
::
contains
(
test
,
"
\"
x
\"
[label=
\"
@param:x
\"
]"
));
EXPECT
(
migraphx
::
contains
(
test
,
"
\"
@3
\"
[label=
\"
sum
\"
]"
));
EXPECT
(
migraphx
::
contains
(
test
,
"
\"
@4
\"
[label=
\"
sum
\"
]"
));
EXPECT
(
migraphx
::
contains
(
test
,
"
\"
x
\"
->
\"
@3
\"
"
));
EXPECT
(
migraphx
::
contains
(
test
,
"
\"
y
\"
->
\"
@3
\"
"
));
EXPECT
(
migraphx
::
contains
(
test
,
"
\"
@3
\"
->
\"
@4
\"
"
));
EXPECT
(
migraphx
::
contains
(
test
,
"
\"
@0
\"
->
\"
@4
\"
"
));
EXPECT
(
migraphx
::
contains
(
test
,
"[label=
\"
int64_type, {1}, {0}
\"
]"
));
}
}
int
main
(
int
argc
,
const
char
*
argv
[])
{
test
::
run
(
argc
,
argv
);
}
int
main
(
int
argc
,
const
char
*
argv
[])
{
test
::
run
(
argc
,
argv
);
}
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