Message ID | 20220803112150.3040287-2-paul.elder@ideasonboard.com |
---|---|
State | Superseded |
Headers | show |
Series |
|
Related | show |
Hi Paul, Thank you for the patch. On Wed, Aug 03, 2022 at 08:21:42PM +0900, Paul Elder via libcamera-devel wrote: > Add an enum field to the test struct member to test > serialization/deserialization of enums that are struct members. > > Signed-off-by: Paul Elder <paul.elder@ideasonboard.com> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> > --- > .../generated_serializer/generated_serializer_test.cpp | 4 ++++ > .../generated_serializer/include/libcamera/ipa/test.mojom | 1 + > 2 files changed, 5 insertions(+) > > diff --git a/test/serialization/generated_serializer/generated_serializer_test.cpp b/test/serialization/generated_serializer/generated_serializer_test.cpp > index 698c81d6..a4639a80 100644 > --- a/test/serialization/generated_serializer/generated_serializer_test.cpp > +++ b/test/serialization/generated_serializer/generated_serializer_test.cpp > @@ -51,6 +51,7 @@ if (struct1.field != struct2.field) { \ > t.s2 = "goodbye"; > t.s3 = "lorem ipsum"; > t.i = 58527; > + t.c = ipa::test::IPAOperationInit; > > std::vector<uint8_t> serialized; > > @@ -69,6 +70,7 @@ if (struct1.field != struct2.field) { \ > TEST_FIELD_EQUALITY(t, u, s2); > TEST_FIELD_EQUALITY(t, u, s3); > TEST_FIELD_EQUALITY(t, u, i); > + TEST_FIELD_EQUALITY(t, u, c); > > > /* Test vector of generated structs */ > @@ -92,11 +94,13 @@ if (struct1.field != struct2.field) { \ > TEST_FIELD_EQUALITY(v[0], w[0], s2); > TEST_FIELD_EQUALITY(v[0], w[0], s3); > TEST_FIELD_EQUALITY(v[0], w[0], i); > + TEST_FIELD_EQUALITY(v[0], w[0], c); > > TEST_FIELD_EQUALITY(v[1], w[1], s1); > TEST_FIELD_EQUALITY(v[1], w[1], s2); > TEST_FIELD_EQUALITY(v[1], w[1], s3); > TEST_FIELD_EQUALITY(v[1], w[1], i); > + TEST_FIELD_EQUALITY(v[1], w[1], c); > > return TestPass; > } > diff --git a/test/serialization/generated_serializer/include/libcamera/ipa/test.mojom b/test/serialization/generated_serializer/include/libcamera/ipa/test.mojom > index 5f200885..73081b40 100644 > --- a/test/serialization/generated_serializer/include/libcamera/ipa/test.mojom > +++ b/test/serialization/generated_serializer/include/libcamera/ipa/test.mojom > @@ -18,6 +18,7 @@ struct TestStruct { > string s2; > int32 i; > string s3; > + IPAOperationCode c; > }; > > interface IPATestInterface {
Quoting Paul Elder via libcamera-devel (2022-08-03 12:21:42) > Add an enum field to the test struct member to test > serialization/deserialization of enums that are struct members. > > Signed-off-by: Paul Elder <paul.elder@ideasonboard.com> Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com> > --- > .../generated_serializer/generated_serializer_test.cpp | 4 ++++ > .../generated_serializer/include/libcamera/ipa/test.mojom | 1 + > 2 files changed, 5 insertions(+) > > diff --git a/test/serialization/generated_serializer/generated_serializer_test.cpp b/test/serialization/generated_serializer/generated_serializer_test.cpp > index 698c81d6..a4639a80 100644 > --- a/test/serialization/generated_serializer/generated_serializer_test.cpp > +++ b/test/serialization/generated_serializer/generated_serializer_test.cpp > @@ -51,6 +51,7 @@ if (struct1.field != struct2.field) { \ > t.s2 = "goodbye"; > t.s3 = "lorem ipsum"; > t.i = 58527; > + t.c = ipa::test::IPAOperationInit; > > std::vector<uint8_t> serialized; > > @@ -69,6 +70,7 @@ if (struct1.field != struct2.field) { \ > TEST_FIELD_EQUALITY(t, u, s2); > TEST_FIELD_EQUALITY(t, u, s3); > TEST_FIELD_EQUALITY(t, u, i); > + TEST_FIELD_EQUALITY(t, u, c); > > > /* Test vector of generated structs */ > @@ -92,11 +94,13 @@ if (struct1.field != struct2.field) { \ > TEST_FIELD_EQUALITY(v[0], w[0], s2); > TEST_FIELD_EQUALITY(v[0], w[0], s3); > TEST_FIELD_EQUALITY(v[0], w[0], i); > + TEST_FIELD_EQUALITY(v[0], w[0], c); > > TEST_FIELD_EQUALITY(v[1], w[1], s1); > TEST_FIELD_EQUALITY(v[1], w[1], s2); > TEST_FIELD_EQUALITY(v[1], w[1], s3); > TEST_FIELD_EQUALITY(v[1], w[1], i); > + TEST_FIELD_EQUALITY(v[1], w[1], c); > > return TestPass; > } > diff --git a/test/serialization/generated_serializer/include/libcamera/ipa/test.mojom b/test/serialization/generated_serializer/include/libcamera/ipa/test.mojom > index 5f200885..73081b40 100644 > --- a/test/serialization/generated_serializer/include/libcamera/ipa/test.mojom > +++ b/test/serialization/generated_serializer/include/libcamera/ipa/test.mojom > @@ -18,6 +18,7 @@ struct TestStruct { > string s2; > int32 i; > string s3; > + IPAOperationCode c; > }; > > interface IPATestInterface { > -- > 2.30.2 >
diff --git a/test/serialization/generated_serializer/generated_serializer_test.cpp b/test/serialization/generated_serializer/generated_serializer_test.cpp index 698c81d6..a4639a80 100644 --- a/test/serialization/generated_serializer/generated_serializer_test.cpp +++ b/test/serialization/generated_serializer/generated_serializer_test.cpp @@ -51,6 +51,7 @@ if (struct1.field != struct2.field) { \ t.s2 = "goodbye"; t.s3 = "lorem ipsum"; t.i = 58527; + t.c = ipa::test::IPAOperationInit; std::vector<uint8_t> serialized; @@ -69,6 +70,7 @@ if (struct1.field != struct2.field) { \ TEST_FIELD_EQUALITY(t, u, s2); TEST_FIELD_EQUALITY(t, u, s3); TEST_FIELD_EQUALITY(t, u, i); + TEST_FIELD_EQUALITY(t, u, c); /* Test vector of generated structs */ @@ -92,11 +94,13 @@ if (struct1.field != struct2.field) { \ TEST_FIELD_EQUALITY(v[0], w[0], s2); TEST_FIELD_EQUALITY(v[0], w[0], s3); TEST_FIELD_EQUALITY(v[0], w[0], i); + TEST_FIELD_EQUALITY(v[0], w[0], c); TEST_FIELD_EQUALITY(v[1], w[1], s1); TEST_FIELD_EQUALITY(v[1], w[1], s2); TEST_FIELD_EQUALITY(v[1], w[1], s3); TEST_FIELD_EQUALITY(v[1], w[1], i); + TEST_FIELD_EQUALITY(v[1], w[1], c); return TestPass; } diff --git a/test/serialization/generated_serializer/include/libcamera/ipa/test.mojom b/test/serialization/generated_serializer/include/libcamera/ipa/test.mojom index 5f200885..73081b40 100644 --- a/test/serialization/generated_serializer/include/libcamera/ipa/test.mojom +++ b/test/serialization/generated_serializer/include/libcamera/ipa/test.mojom @@ -18,6 +18,7 @@ struct TestStruct { string s2; int32 i; string s3; + IPAOperationCode c; }; interface IPATestInterface {
Add an enum field to the test struct member to test serialization/deserialization of enums that are struct members. Signed-off-by: Paul Elder <paul.elder@ideasonboard.com> --- .../generated_serializer/generated_serializer_test.cpp | 4 ++++ .../generated_serializer/include/libcamera/ipa/test.mojom | 1 + 2 files changed, 5 insertions(+)