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
cf11f657
Commit
cf11f657
authored
May 05, 2018
by
Paul
Browse files
Formatting
parent
13a9d276
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
9 additions
and
10 deletions
+9
-10
include/rtg/operation.hpp
include/rtg/operation.hpp
+1
-4
test/operation.cpp
test/operation.cpp
+8
-5
test/test.hpp
test/test.hpp
+0
-1
No files found.
include/rtg/operation.hpp
View file @
cf11f657
...
@@ -128,10 +128,7 @@ struct operation
...
@@ -128,10 +128,7 @@ struct operation
return
std
::
make_shared
<
private_detail_te_handle_type
>
(
private_detail_te_value
);
return
std
::
make_shared
<
private_detail_te_handle_type
>
(
private_detail_te_value
);
}
}
const
std
::
type_info
&
type
()
const
override
const
std
::
type_info
&
type
()
const
override
{
return
typeid
(
private_detail_te_value
);
}
{
return
typeid
(
private_detail_te_value
);
}
std
::
string
name
()
const
override
{
return
private_detail_te_value
.
name
();
}
std
::
string
name
()
const
override
{
return
private_detail_te_value
.
name
();
}
...
...
test/operation.cpp
View file @
cf11f657
...
@@ -21,20 +21,23 @@ void operation_copy_test()
...
@@ -21,20 +21,23 @@ void operation_copy_test()
EXPECT
(
op2
.
name
()
==
op1
.
name
());
EXPECT
(
op2
.
name
()
==
op1
.
name
());
}
}
struct
not_operation
{};
struct
not_operation
{
};
void
operation_any_cast
()
void
operation_any_cast
()
{
{
rtg
::
operation
op1
=
simple_operation
{};
rtg
::
operation
op1
=
simple_operation
{};
EXPECT
(
rtg
::
any_cast
<
simple_operation
>
(
op1
).
data
==
1
);
EXPECT
(
rtg
::
any_cast
<
simple_operation
>
(
op1
).
data
==
1
);
EXPECT
(
rtg
::
any_cast
<
not_operation
*>
(
&
op1
)
==
nullptr
);
EXPECT
(
rtg
::
any_cast
<
not_operation
*>
(
&
op1
)
==
nullptr
);
EXPECT
(
test
::
throws
([
&
]{
rtg
::
any_cast
<
not_operation
&>
(
op1
);
}));
EXPECT
(
test
::
throws
([
&
]
{
rtg
::
any_cast
<
not_operation
&>
(
op1
);
}));
rtg
::
operation
op2
=
simple_operation
{
2
};
rtg
::
operation
op2
=
simple_operation
{
2
};
EXPECT
(
rtg
::
any_cast
<
simple_operation
>
(
op2
).
data
==
2
);
EXPECT
(
rtg
::
any_cast
<
simple_operation
>
(
op2
).
data
==
2
);
EXPECT
(
rtg
::
any_cast
<
not_operation
*>
(
&
op2
)
==
nullptr
);
EXPECT
(
rtg
::
any_cast
<
not_operation
*>
(
&
op2
)
==
nullptr
);
}
}
int
main
()
{
int
main
()
{
operation_copy_test
();
operation_copy_test
();
operation_any_cast
();
operation_any_cast
();
}
}
test/test.hpp
View file @
cf11f657
...
@@ -27,7 +27,6 @@ namespace test {
...
@@ -27,7 +27,6 @@ namespace test {
TEST_FOREACH_OPERATOR
(
TEST_EACH_OPERATOR_OBJECT
)
TEST_FOREACH_OPERATOR
(
TEST_EACH_OPERATOR_OBJECT
)
inline
std
::
ostream
&
operator
<<
(
std
::
ostream
&
s
,
std
::
nullptr_t
)
inline
std
::
ostream
&
operator
<<
(
std
::
ostream
&
s
,
std
::
nullptr_t
)
{
{
s
<<
"nullptr"
;
s
<<
"nullptr"
;
...
...
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