Skip to content

Navigation Menu

Sign in
Appearance settings
Sign up
Appearance settings

Commit cc11c2b

Browse filesBrowse the repository at this point in the historyBrowse files
committed
Merge bitcoin-core/libmultiprocess#338: test: check ReadList return value
62f25af test: check ReadList return value (Ryan Ofsky) Pull request description: This is a followup to bitcoin-core/libmultiprocess#285 (comment), adding a test to verify the `ReadList` return value and make sure it is compatible with `ReadDestTemp` ACKs for top commit: ViniciusCestarii: ACK 62f25af Tree-SHA512: 690bb268197e81ccb450efd1ae783d12f7ef0ef0360351418cbdf0b4713eb1d1b7932e0f24229d6b718d6b767c8b9883fa5a769ec41cc8bc04e4bb65463705d8
2 parents 2d6e863 + 62f25af commit cc11c2b
Copy full SHA for cc11c2b

4 files changed

+6Lines changed: 6 additions & 0 deletions

File tree

Expand file treeCollapse file tree
Open diff view settings
Filter options
Expand file treeCollapse file tree
Open diff view settings
Collapse file

‎test/mp/test/foo-types.h‎

Copy file name to clipboardExpand all lines: test/mp/test/foo-types.h
+2Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,7 @@ void CustomBuildField(TypeList<FooCustom>, Priority<1>, InvokeContext& invoke_co
4646
{
4747
BuildField(TypeList<std::string>(), invoke_context, output, value.v1);
4848
output.setV2(value.v2);
49+
BuildField(TypeList<std::vector<int>>(), invoke_context, output, value.v3);
4950
}
5051

5152
template <typename Input, typename ReadDest>
@@ -55,6 +56,7 @@ decltype(auto) CustomReadField(TypeList<FooCustom>, Priority<1>, InvokeContext&
5556
return read_dest.update([&](FooCustom& value) {
5657
value.v1 = ReadField(TypeList<std::string>(), invoke_context, mp::Make<mp::ValueField>(custom.getV1()), ReadDestTemp<std::string>());
5758
value.v2 = custom.getV2();
59+
value.v3 = ReadField(TypeList<std::vector<int>>(), invoke_context, mp::Make<mp::ValueField>(custom.getV3()), ReadDestTemp<std::vector<int>>());
5860
});
5961
}
6062

Collapse file

‎test/mp/test/foo.capnp‎

Copy file name to clipboardExpand all lines: test/mp/test/foo.capnp
+1Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,7 @@ struct FooStruct $Proxy.wrap("mp::test::FooStruct") {
7070
struct FooCustom $Proxy.wrap("mp::test::FooCustom") {
7171
v1 @0 :Text;
7272
v2 @1 :Int32;
73+
v3 @2 :List(Int32);
7374
}
7475

7576
struct FooEmpty $Proxy.wrap("mp::test::FooEmpty") {
Collapse file

‎test/mp/test/foo.h‎

Copy file name to clipboardExpand all lines: test/mp/test/foo.h
+1Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ struct FooCustom
3434
{
3535
std::string v1;
3636
int v2;
37+
std::vector<int> v3;
3738
};
3839

3940
struct FooEmpty
Collapse file

‎test/mp/test/test.cpp‎

Copy file name to clipboardExpand all lines: test/mp/test/test.cpp
+2Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -234,9 +234,11 @@ KJ_TEST("Call FooInterface methods")
234234
FooCustom custom_in;
235235
custom_in.v1 = "v1";
236236
custom_in.v2 = 5;
237+
custom_in.v3 = {10, 20, 30};
237238
FooCustom custom_out = foo->passCustom(custom_in);
238239
KJ_EXPECT(custom_in.v1 == custom_out.v1);
239240
KJ_EXPECT(custom_in.v2 == custom_out.v2);
241+
KJ_EXPECT(custom_in.v3 == custom_out.v3);
240242

241243
foo->passEmpty(FooEmpty{});
242244

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.