From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on gnuweeb.org X-Spam-Level: X-Spam-Status: No, score=-0.8 required=5.0 tests=ALL_TRUSTED,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,NO_DNS_FOR_FROM,URIBL_BLOCKED autolearn=no autolearn_force=no version=3.4.6 Received: from localhost.localdomain (unknown [180.246.144.41]) by gnuweeb.org (Postfix) with ESMTPSA id CF54780A06; Sun, 21 Aug 2022 11:25:22 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gnuweeb.org; s=default; t=1661081124; bh=4y4Nq7JFwpNLzVj0tmBRxPqefSaCtoSdaLYk5wUd1q8=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=W8MyqtIcoXjK+HpdW0yQ253Joe/YdlfRkiFDvJd4GNvsBCbXPoIRcpEPPyLx2wJQf zIzbPgVjTCfGdQ3yXrMX7Flfsa5mxZcYkVsybUA6A9xElX0W0UjQ8ybPHHdxlJJZRB eknXZpYN0X19TEu9OSq0zyhE0lY2OHL42Ok26vATfhafEef0KBlFRwWcrSvL/lrnAp oT0jr1U6t27LpFFeT/wAjambJaFgb9E39Izzd8PZYqDDbcRe+dXqFMKN3xV3+uVoKn tlCteyybza8FncAaqy6xxHJn6Od/3zO/8dkIBK1kl9FG/vL4aF0I7/SnJ+aSG1lhB1 2NuiCLl5xiClA== From: Ammar Faizi To: Alviro Iskandar Setiawan Cc: Ammar Faizi , Muhammad Rizki , Kanna Scarlet , GNU/Weeb Mailing List Subject: [PATCH v1 03/22] tests/js/ring: Update the unit test to utilize set_user_data Date: Sun, 21 Aug 2022 18:24:34 +0700 Message-Id: <20220821112453.3026255-4-ammarfaizi2@gnuweeb.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20220821112453.3026255-1-ammarfaizi2@gnuweeb.org> References: <20220821112453.3026255-1-ammarfaizi2@gnuweeb.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit List-Id: A previous commit adds set_user_data support on the SQE. Test this new functionality. Signed-off-by: Ammar Faizi --- tests/js/ring.js | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/tests/js/ring.js b/tests/js/ring.js index 94ebb2c..de4baaf 100644 --- a/tests/js/ring.js +++ b/tests/js/ring.js @@ -11,7 +11,7 @@ function assert(cond) function test_nop() { - const entry = 4096; + const entry = 16; let ring; let cqe; let sqe; @@ -65,6 +65,7 @@ function test_chnet_ring_multiple() sqe = ring.get_sqe(); assert(sqe); sqe.prep_start(ch[i]); + sqe.set_user_data(ch[i]); } assert(ring.submit_sqe() == i); ring.wait_cqe(i); @@ -79,15 +80,14 @@ function test_chnet_ring_multiple() sqe = ring.get_sqe(); assert(sqe); sqe.prep_read(ch[i], 1024); + sqe.set_user_data(ch[i]); } assert(ring.submit_sqe() == i); ring.wait_cqe(i); j = ring.for_each_cqe(function (cqe) { - /* - * TODO(ammarfaizi2): Add buffer string assertion. - */ - + let ch = cqe.user_data; assert(cqe.res == 13); + assert(ch.read_buf()); }); assert(j == i); ring.cq_advance(j); -- Ammar Faizi