Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions test/mp/test/foo.capnp
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ interface FooInterface $Proxy.wrap("mp::test::FooImplementation") {
passMessage @13 (arg :FooMessage) -> (result :FooMessage);
passMutable @14 (arg :FooMutable) -> (arg :FooMutable);
passEnum @15 (arg :Int32) -> (result :Int32);
passDouble @23 (arg :Float64) -> (result :Float64);
passFn @16 (context :Proxy.Context, fn :FooFn) -> (result :Int32);
callFn @17 () -> ();
callFnAsync @18 (context :Proxy.Context) -> ();
Expand Down
1 change: 1 addition & 0 deletions test/mp/test/foo.h
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,7 @@ class FooImplementation
FooMessage passMessage(FooMessage foo) { foo.message += " call"; return foo; }
void passMutable(FooMutable& foo) { foo.message += " call"; }
FooEnum passEnum(FooEnum foo) { return foo; }
double passDouble(double value) { return value; }
int passFn(std::function<int()> fn) { return fn(); }
std::vector<FooDataRef> passDataPointers(std::vector<FooDataRef> values) { return values; }
std::shared_ptr<FooCallback> m_callback;
Expand Down
2 changes: 2 additions & 0 deletions test/mp/test/test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -230,6 +230,8 @@ KJ_TEST("Call FooInterface methods")
foo->passMutable(mut);
KJ_EXPECT(mut.message == "init build pass call return read");

KJ_EXPECT(foo->passDouble(1.25) == 1.25);

KJ_EXPECT(foo->passFn([]{ return 10; }) == 10);

std::vector<FooDataRef> data_in;
Expand Down
Loading