From patchwork Tue Oct 11 10:58:51 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Paul Elder X-Patchwork-Id: 17579 Return-Path: X-Original-To: parsemail@patchwork.libcamera.org Delivered-To: parsemail@patchwork.libcamera.org Received: from lancelot.ideasonboard.com (lancelot.ideasonboard.com [92.243.16.209]) by patchwork.libcamera.org (Postfix) with ESMTPS id B164AC0DA4 for ; Tue, 11 Oct 2022 10:59:16 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id 6B5CF62D74; Tue, 11 Oct 2022 12:59:16 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=libcamera.org; s=mail; t=1665485956; bh=WYM0INlaGtOuymy12t/4WjDb5+v30IdZbRkSjhURYGc=; h=To:Date:In-Reply-To:References:Subject:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To: From; b=k/yc8IP1p9u3mb7deqmBXtMi9oIADTKJ7qT4vIPVsvrdBvmA4u9c5OGe9iILjPTAV CPECff9ZElJtohRB3lOYOV5+dQmUSvS2geJzUO/XIz5FNZ9yGdub1gc7hG+1LVdrnl 9wmiCkZIccf2ML8NXSV52o7ABxtxERCzjS3kCVpHsc2L4MdtrAIx27ZwDGuDzElJF3 4gANrFoNSw/TfH7ooFr63MhM0s2iC00KLhhtYFfykQ74MKh5z9Z0DsGqqpCwFFiShu JbtBW7wOgjHQ7jWMVMrM3304Nk34fwTsEe15ZlMmTi4OihdRzAj7963CEJkzO04h2o EBeOyJsIHcbnw== Received: from perceval.ideasonboard.com (perceval.ideasonboard.com [IPv6:2001:4b98:dc2:55:216:3eff:fef7:d647]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id D2A3162D4E for ; Tue, 11 Oct 2022 12:59:14 +0200 (CEST) Authentication-Results: lancelot.ideasonboard.com; dkim=pass (1024-bit key; unprotected) header.d=ideasonboard.com header.i=@ideasonboard.com header.b="oVgJtbYo"; dkim-atps=neutral Received: from pyrite.rasen.tech (h175-177-042-159.catv02.itscom.jp [175.177.42.159]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id C0829AFC; Tue, 11 Oct 2022 12:59:12 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1665485954; bh=WYM0INlaGtOuymy12t/4WjDb5+v30IdZbRkSjhURYGc=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=oVgJtbYok/pqL34D8JbucgBL7V7NH6YdMBYo7EAbvtdyf/b0o2BtCLMVtcHVMUuNA +14Dtnyz9lYQTGeLobIO3koFgmT+81XWekBRNGo3aQbBXe9KniTh3VBsNIAva9bp+a UuV29Y7ocl6qVxRg8zw8dK7RkHFJ5uIu9DUrGcDU= To: libcamera-devel@lists.libcamera.org Date: Tue, 11 Oct 2022 19:58:51 +0900 Message-Id: <20221011105859.457567-2-paul.elder@ideasonboard.com> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20221011105859.457567-1-paul.elder@ideasonboard.com> References: <20221011105859.457567-1-paul.elder@ideasonboard.com> MIME-Version: 1.0 Subject: [libcamera-devel] [PATCH v5 1/9] test: generated_serializer: Test enum that is struct member X-BeenThere: libcamera-devel@lists.libcamera.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-Patchwork-Original-From: Paul Elder via libcamera-devel From: Paul Elder Reply-To: Paul Elder Errors-To: libcamera-devel-bounces@lists.libcamera.org Sender: "libcamera-devel" Add an enum field to the test struct member to test serialization/deserialization of enums that are struct members. Signed-off-by: Paul Elder Reviewed-by: Laurent Pinchart Reviewed-by: Kieran Bingham --- No change in v5 No change in v4 No change in v3 No change in v2 --- .../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 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 {