Skip to content

Commit 110349f

Browse files
committed
test: Add coverage for enum/int conversions
1 parent bbc80ab commit 110349f

File tree

2 files changed

+4
-0
lines changed

2 files changed

+4
-0
lines changed

test/mp/test/foo.capnp

+1
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ interface FooInterface $Proxy.wrap("mp::test::FooImplementation") {
2727
passEmpty @12 (arg :FooEmpty) -> (result :FooEmpty);
2828
passMessage @13 (arg :FooMessage) -> (result :FooMessage);
2929
passMutable @14 (arg :FooMutable) -> (arg :FooMutable);
30+
passEnum @15 (arg :Int32) -> (result :Int32);
3031
}
3132

3233
interface FooCallback $Proxy.wrap("mp::test::FooCallback") {

test/mp/test/foo.h

+3
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,8 @@ struct FooStruct
2121
std::vector<bool> vbool;
2222
};
2323

24+
enum class FooEnum : int { ONE = 1, TWO = 2, };
25+
2426
struct FooCustom
2527
{
2628
std::string v1;
@@ -72,6 +74,7 @@ class FooImplementation
7274
FooEmpty passEmpty(FooEmpty foo) { return foo; }
7375
FooMessage passMessage(FooMessage foo) { foo.message += " call"; return foo; }
7476
void passMutable(FooMutable& foo) { foo.message += " call"; }
77+
FooEnum passEnum(FooEnum foo) { return foo; }
7578
std::shared_ptr<FooCallback> m_callback;
7679
};
7780

0 commit comments

Comments
 (0)