From nobody Sun Nov 9 14:48:08 2025 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=linaro.org Return-Path: Received: from lists.gnu.org (209.51.188.17 [209.51.188.17]) by mx.zohomail.com with SMTPS id 1551331633978125.6718545340417; Wed, 27 Feb 2019 21:27:13 -0800 (PST) Received: from localhost ([127.0.0.1]:60585 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gzEDl-0006r7-Rf for importer@patchew.org; Thu, 28 Feb 2019 00:27:01 -0500 Received: from eggs.gnu.org ([209.51.188.92]:59622) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gzEBg-0005g1-8H for qemu-devel@nongnu.org; Thu, 28 Feb 2019 00:24:53 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gzEBe-0003mZ-7n for qemu-devel@nongnu.org; Thu, 28 Feb 2019 00:24:52 -0500 Received: from mail-pl1-x642.google.com ([2607:f8b0:4864:20::642]:45354) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1gzEBc-0003kf-81 for qemu-devel@nongnu.org; Thu, 28 Feb 2019 00:24:50 -0500 Received: by mail-pl1-x642.google.com with SMTP id r14so9142862pls.12 for ; Wed, 27 Feb 2019 21:24:46 -0800 (PST) Received: from cloudburst.dc.rr.com (cpe-72-132-251-149.dc.res.rr.com. [72.132.251.149]) by smtp.gmail.com with ESMTPSA id u13sm32758371pfa.169.2019.02.27.21.24.43 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Wed, 27 Feb 2019 21:24:44 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=8ulPBZ7h8lwje33FAm/1yxM4mNmEPfuMt2JEIkVfEzs=; b=eSIR8T7qebdfYMduSHNv62RSpVKAKNaP8oLD/HWXhITjOwQSZ2qoDNXU0agwjmdwGd wZkNuH+QZkOf9XhWMAmeo1FpFqI5cuyGdkpSDhWy1cJnAwSrmH8ZVHv0yuK/G3Q162OP C3y/zLKBzsoJgY56FtO1UX9rCo2QiMXiovfvJ1NqHup68IW265fmEEZWeXNPySkNWKnp /1DgOWXImk57sFlcnUXewvDMajL++jBTCqwilr4+acleXQoRnajebohIYhixrUVS8mUy Sk/x+oY6e3Drfabm63q5e6/YwrOPa6FOrawYB37ioSfE3D0HUYZYIu6U0O+Dqi/oB1ws vbnw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=8ulPBZ7h8lwje33FAm/1yxM4mNmEPfuMt2JEIkVfEzs=; b=Q59AfXDVsrPDhzYUz+khFpGiUKaWvfcx2qKoTlbMzFYhY9ADrd7OkjgGD/YJL9JIay av4X0O0Uk15DOPtcwtLQWpD8cL6DHLtG0HXaSv9GGUIbt+4QXk790VG4DOlcANQ94q7I FmqQl+0RWI6Ke6PH6xs7XOhVrIp4MH5e5a9I9qvXB2Q2X90EcO0BM/Cj+/aICifj0Ety K6YzRjoCfcpp5Q1zxdtqO7wmSA+zvxWIPWG/VDJ5vrxdhNbQHo2d44rqkrm6xEII6Qpl HKoafZq14sk0z13rE2Tpz+ZEe4/tyB7M7uXkYCwSQ9EnjlWTuEXJkiUvdBOL5AJJaFM6 WmMA== X-Gm-Message-State: AHQUAub8MbG1wJ+3CPexlMWVQhhRw6HthTjomRr0OxZ55sDZYrNiek15 Pcvq5eWBs9TBivAFHPQ8V78hLkIoRmo= X-Google-Smtp-Source: AHgI3IYj5TkpwM8ogAsz4YQF5y68SZUa93t/Asomtk4ZzArT6N1FUk4nhxywkLkLN6C1Adv5n0z9Sg== X-Received: by 2002:a17:902:1aa:: with SMTP id b39mr6107471plb.317.1551331485114; Wed, 27 Feb 2019 21:24:45 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Date: Wed, 27 Feb 2019 21:24:31 -0800 Message-Id: <20190228052432.32571-8-richard.henderson@linaro.org> X-Mailer: git-send-email 2.17.2 In-Reply-To: <20190228052432.32571-1-richard.henderson@linaro.org> References: <20190228052432.32571-1-richard.henderson@linaro.org> X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:4864:20::642 Subject: [Qemu-devel] [PATCH v2 7/8] test/decode: Add tests for PatternGroups X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: kbastian@mail.uni-paderborn.de, f4bug@amsat.org Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" From: Bastian Koppelmann This adds one test that supposed to succeed to test deep nesting of pattern groups which is rarely exercised by targets using decode tree. The remaining tests exercise various fail conditions. Signed-off-by: Bastian Koppelmann Message-Id: <20190227120217.20794-1-kbastian@mail.uni-paderborn.de> Signed-off-by: Richard Henderson --- tests/decode/check.sh | 6 ++++++ tests/decode/err_pattern_group_empty.decode | 6 ++++++ tests/decode/err_pattern_group_ident1.decode | 10 +++++++++ tests/decode/err_pattern_group_ident2.decode | 11 ++++++++++ tests/decode/err_pattern_group_nest1.decode | 13 ++++++++++++ tests/decode/succ_pattern_group_nest1.decode | 22 ++++++++++++++++++++ 6 files changed, 68 insertions(+) create mode 100644 tests/decode/err_pattern_group_empty.decode create mode 100644 tests/decode/err_pattern_group_ident1.decode create mode 100644 tests/decode/err_pattern_group_ident2.decode create mode 100644 tests/decode/err_pattern_group_nest1.decode create mode 100644 tests/decode/succ_pattern_group_nest1.decode diff --git a/tests/decode/check.sh b/tests/decode/check.sh index 79a06c37cd..95445a0115 100755 --- a/tests/decode/check.sh +++ b/tests/decode/check.sh @@ -15,4 +15,10 @@ for i in err_*.decode; do fi done =20 +for i in succ_*.decode; do + if ! $PYTHON $DECODETREE $i > /dev/null 2> /dev/null; then + echo FAIL:$i 1>&2 + fi +done + exit $E diff --git a/tests/decode/err_pattern_group_empty.decode b/tests/decode/err= _pattern_group_empty.decode new file mode 100644 index 0000000000..abbff6b528 --- /dev/null +++ b/tests/decode/err_pattern_group_empty.decode @@ -0,0 +1,6 @@ +# This work is licensed under the terms of the GNU LGPL, version 2 or late= r. +# See the COPYING.LIB file in the top-level directory. + +# empty groups are not allowed +{ +} diff --git a/tests/decode/err_pattern_group_ident1.decode b/tests/decode/er= r_pattern_group_ident1.decode new file mode 100644 index 0000000000..3e65fab2f9 --- /dev/null +++ b/tests/decode/err_pattern_group_ident1.decode @@ -0,0 +1,10 @@ +# This work is licensed under the terms of the GNU LGPL, version 2 or late= r. +# See the COPYING.LIB file in the top-level directory. + +%sub1 0:8 + +# Make sure that indentation is enforced +{ + top 00000000 00000000 00000000 00000000 + sub1 00000000 00000000 00000000 ........ %sub1 +} diff --git a/tests/decode/err_pattern_group_ident2.decode b/tests/decode/er= r_pattern_group_ident2.decode new file mode 100644 index 0000000000..bc859233b1 --- /dev/null +++ b/tests/decode/err_pattern_group_ident2.decode @@ -0,0 +1,11 @@ +# This work is licensed under the terms of the GNU LGPL, version 2 or late= r. +# See the COPYING.LIB file in the top-level directory. + +%sub1 0:8 + +# Make sure that indentation is enforced +{ + top 00000000 00000000 00000000 00000000 + sub1 00000000 00000000 00000000 ........ %sub1 +# comments are suposed to be indented +} diff --git a/tests/decode/err_pattern_group_nest1.decode b/tests/decode/err= _pattern_group_nest1.decode new file mode 100644 index 0000000000..92e971c3c5 --- /dev/null +++ b/tests/decode/err_pattern_group_nest1.decode @@ -0,0 +1,13 @@ +# This work is licensed under the terms of the GNU LGPL, version 2 or late= r. +# See the COPYING.LIB file in the top-level directory. + +%sub1 0:8 +%sub2 8:8 +%sub3 16:8 +%sub4 24:8 + +# Groups with no overlap are supposed to fail +{ + top 00000000 00000000 00000000 00000000 + sub4 ........ ........ ........ ........ %sub1 %sub2 %sub3 %sub4 +} diff --git a/tests/decode/succ_pattern_group_nest1.decode b/tests/decode/su= cc_pattern_group_nest1.decode new file mode 100644 index 0000000000..77b0f48b49 --- /dev/null +++ b/tests/decode/succ_pattern_group_nest1.decode @@ -0,0 +1,22 @@ +# This work is licensed under the terms of the GNU LGPL, version 2 or late= r. +# See the COPYING.LIB file in the top-level directory. + +%sub1 0:8 +%sub2 8:8 +%sub3 16:8 +%sub4 24:7 + +# Make sure deep netsting works, as few targets will actually exercise it +{ + top 00000000 00000000 00000000 00000000 + { + sub1 00000000 00000000 00000000 ........ %sub1 + { + sub2 00000000 00000000 ........ ........ %sub1 %sub2 + { + sub3 00000000 ........ ........ ........ %sub1 %sub2 %sub3 + sub4 0....... ........ ........ ........ %sub1 %sub2 %sub3 %sub4 + } + } + } +} --=20 2.17.2