File tree Expand file tree Collapse file tree 3 files changed +4
-0
lines changed Expand file tree Collapse file tree 3 files changed +4
-0
lines changed Original file line number Diff line number Diff line change @@ -14,6 +14,7 @@ $Proxy.includeTypes("mp/test/foo-types.h");
1414interface FooInterface $Proxy.wrap("mp::test::FooImplementation" ) {
1515 add @0 (a :Int32 , b :Int32 ) -> (result :Int32 );
1616 addOut @19 (a :Int32 , b :Int32 ) -> (ret :Int32 );
17+ addInOut @20 (x :Int32 , sum :Int32 ) -> (sum :Int32 );
1718 mapSize @1 (map :List(Pair(Text , Text))) -> (result :Int32 );
1819 pass @2 (arg :FooStruct) -> (result :FooStruct) ;
1920 raise @3 (arg :FooStruct) -> (error :FooStruct $Proxy.exception("mp::test::FooStruct" ));
Original file line number Diff line number Diff line change @@ -63,6 +63,7 @@ class FooImplementation
6363public:
6464 int add (int a, int b) { return a + b; }
6565 void addOut (int a, int b, int & out) { out = a + b; }
66+ void addInOut (int x, int & sum) { sum += x; }
6667 int mapSize (const std::map<std::string, std::string>& map) { return map.size (); }
6768 FooStruct pass (FooStruct foo) { return foo; }
6869 void raise (FooStruct foo) { throw foo; }
Original file line number Diff line number Diff line change @@ -116,6 +116,8 @@ KJ_TEST("Call FooInterface methods")
116116 int ret;
117117 foo->addOut (3 , 4 , ret);
118118 KJ_EXPECT (ret == 7 );
119+ foo->addInOut (3 , ret);
120+ KJ_EXPECT (ret == 10 );
119121
120122 FooStruct in;
121123 in.name = " name" ;
You can’t perform that action at this time.
0 commit comments