From faaedb11f8a75b26941820aac7dbdabe164a4647 Mon Sep 17 00:00:00 2001 From: marco <*~=`'#}+{/-|&$^_@721217.xyz> Date: Wed, 10 Jun 2026 08:48:07 +0200 Subject: [PATCH] test: Add passDouble smoke test Mostly for clang-tidy to cover commit 733c64318d1c75acee8cea74abaf88050453c089 --- test/mp/test/foo.capnp | 1 + test/mp/test/foo.h | 1 + test/mp/test/test.cpp | 2 ++ 3 files changed, 4 insertions(+) diff --git a/test/mp/test/foo.capnp b/test/mp/test/foo.capnp index 562f249f..31736452 100644 --- a/test/mp/test/foo.capnp +++ b/test/mp/test/foo.capnp @@ -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) -> (); diff --git a/test/mp/test/foo.h b/test/mp/test/foo.h index 7ec59fcc..5b66b85e 100644 --- a/test/mp/test/foo.h +++ b/test/mp/test/foo.h @@ -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 fn) { return fn(); } std::vector passDataPointers(std::vector values) { return values; } std::shared_ptr m_callback; diff --git a/test/mp/test/test.cpp b/test/mp/test/test.cpp index 13fc8e30..337d7786 100644 --- a/test/mp/test/test.cpp +++ b/test/mp/test/test.cpp @@ -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 data_in;