diff --git a/test/mp/test/foo.capnp b/test/mp/test/foo.capnp index 75e4617d..67bc8e4f 100644 --- a/test/mp/test/foo.capnp +++ b/test/mp/test/foo.capnp @@ -13,6 +13,8 @@ $Proxy.includeTypes("mp/test/foo-types.h"); interface FooInterface $Proxy.wrap("mp::test::FooImplementation") { add @0 (a :Int32, b :Int32) -> (result :Int32); + addOut @19 (a :Int32, b :Int32) -> (ret :Int32); + addInOut @20 (x :Int32, sum :Int32) -> (sum :Int32); mapSize @1 (map :List(Pair(Text, Text))) -> (result :Int32); pass @2 (arg :FooStruct) -> (result :FooStruct); raise @3 (arg :FooStruct) -> (error :FooStruct $Proxy.exception("mp::test::FooStruct")); diff --git a/test/mp/test/foo.h b/test/mp/test/foo.h index 70bf4ff1..8415f6f0 100644 --- a/test/mp/test/foo.h +++ b/test/mp/test/foo.h @@ -62,6 +62,8 @@ class FooImplementation { public: int add(int a, int b) { return a + b; } + void addOut(int a, int b, int& out) { out = a + b; } + void addInOut(int x, int& sum) { sum += x; } int mapSize(const std::map& map) { return map.size(); } FooStruct pass(FooStruct foo) { return foo; } void raise(FooStruct foo) { throw foo; } diff --git a/test/mp/test/test.cpp b/test/mp/test/test.cpp index 225d00d5..9273dfae 100644 --- a/test/mp/test/test.cpp +++ b/test/mp/test/test.cpp @@ -113,6 +113,11 @@ KJ_TEST("Call FooInterface methods") ProxyClient* foo = setup.client.get(); KJ_EXPECT(foo->add(1, 2) == 3); + int ret; + foo->addOut(3, 4, ret); + KJ_EXPECT(ret == 7); + foo->addInOut(3, ret); + KJ_EXPECT(ret == 10); FooStruct in; in.name = "name";