From nobody Sat Apr 27 23:13:48 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@gnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@gnu.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1506762281797181.52185659992847; Sat, 30 Sep 2017 02:04:41 -0700 (PDT) Received: from localhost ([::1]:38621 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dyDhF-0003hw-Up for importer@patchew.org; Sat, 30 Sep 2017 05:04:29 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:49923) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dyDgD-0003Bi-4P for qemu-devel@nongnu.org; Sat, 30 Sep 2017 05:03:26 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dyDgA-0003ub-07 for qemu-devel@nongnu.org; Sat, 30 Sep 2017 05:03:25 -0400 Received: from mail-pf0-x243.google.com ([2607:f8b0:400e:c00::243]:34943) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1dyDg9-0003tU-Ph for qemu-devel@nongnu.org; Sat, 30 Sep 2017 05:03:21 -0400 Received: by mail-pf0-x243.google.com with SMTP id i23so1244181pfi.2 for ; Sat, 30 Sep 2017 02:03:21 -0700 (PDT) Received: from localhost.localdomain (c-73-189-82-67.hsd1.ca.comcast.net. [73.189.82.67]) by smtp.gmail.com with ESMTPSA id 76sm9916644pfp.158.2017.09.30.02.03.18 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Sat, 30 Sep 2017 02:03:19 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=CPe8TwlM/qRWC5PhnbbPxt92g4uF4T9I2Wv4Rm1X0z4=; b=U5K94IZd1XLryaZMzav+Zsgkym8ofzQD+Ztf5uph3QtVTSjdVK4RHpYf8mROS+L8M8 ITrmtKmf1X/D+PQxn4u2Kl6A6MfPipldlHNi4dQ4IRzgAv5FcaqVgjmNo26Luwh7b2IA TA5+8jbFPsbr3smPR8noeWj2orBVdgLonozxyKRw0L/v34sCi8w8ZFWUZzpJbZhqQtZ0 tOnaRf9h8e5pScsCaQ283TlCeiG5q6ICVybL9+i51lax6D5PpQwOur5+OA4hZRyppyjT 0Ia4/z1nwLWthwDiB5T0DTaOpNMKoSQ5YhuE5nFn8DdxaiDVZG6p91l+0NlXhF26y1Pr cBCA== 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:mime-version :content-transfer-encoding; bh=CPe8TwlM/qRWC5PhnbbPxt92g4uF4T9I2Wv4Rm1X0z4=; b=JU3UNbwf5w185Gs2uGUVSkVKKxc3xE4fBg6SE9UPSV0sj9niEBv74i9bBBiNidYPxK U0U/DDewnEi0ignRe8Q/f0qF+Zhr0ikgvjLco3XmvApSsBHhMMtlX6Y9JcJ0bLvB1JuI YuoGxrCq5PrWC0eGEbZ4q88pBMiKkjvljycZ8q/9GouHUfCinMAlIeI8Me6nirQKOaiS vLYQXf9PyBP7e7Qm8oF959CV0XRrz+WppO2lUWKT9EluEcR5cOboJrHmLEt2Rqxb58mX EOnbhg3VaZBLnN2WrjzM2DVb3Nm9ZXYa3Y1lmy5BG3/weKZoLthT2pEGeGVlEeSoCsZB HBRg== X-Gm-Message-State: AHPjjUgUYExZttOu9dzV8d0eF+Xshd2SeKanYAJS2hOI9L1/PRWMACa6 RvRIdcbDApRLvZMzUpWZJwVKFaT6yVw= X-Google-Smtp-Source: AOwi7QDsDMimWF76byTou6gU0f+kfiLiNs9fm57jjiTZ6VStYw5/SIdh1hPCVN0krGtBl2FGkvcL8A== X-Received: by 10.101.68.193 with SMTP id g1mr8068224pgs.232.1506762200280; Sat, 30 Sep 2017 02:03:20 -0700 (PDT) From: =?UTF-8?q?Carlo=20Marcelo=20Arenas=20Bel=C3=B3n?= To: qemu-devel@nongnu.org Date: Sat, 30 Sep 2017 02:02:40 -0700 Message-Id: <20170930090240.23729-1-carenas@gmail.com> X-Mailer: git-send-email 2.14.2 MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:400e:c00::243 Subject: [Qemu-devel] [RFC PATCH] tests/tcg: add write tests for nbyte = 0 X-BeenThere: qemu-devel@gnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: peter.maydell@linaro.com, zhuoweizhang@yahoo.com, laurent@vivier.eu, =?UTF-8?q?Carlo=20Marcelo=20Arenas=20Bel=C3=B3n?= Errors-To: qemu-devel-bounces+importer=patchew.org@gnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZohoMail: RDKM_2 RSF_0 Z_629925259 SPT_0 rename linux-test so we can get both (32 and 64 bit) versions in a multilib x86 host. published as an RFC since the include options that were needed to fix the build will most likely conflict with scripts/clean-includes `make check` is unaffected by this new test (which fails in x86_64) and the rule to automatically run it against qemu-user and diff has been left out in purpose, not to affect any user of the remaining surrounding tests, but discussion on how to get tests/tcg back in shape, or if linux-user should be tested somewhere else is also encouraged Signed-off-by: Carlo Marcelo Arenas Bel=C3=B3n --- include/qemu/cutils.h | 2 ++ include/qemu/fprintf-fn.h | 2 ++ tests/tcg/Makefile | 11 +++++++---- tests/tcg/linux-test.c | 9 ++++++++- 4 files changed, 19 insertions(+), 5 deletions(-) diff --git a/include/qemu/cutils.h b/include/qemu/cutils.h index f0878eaafa..2219942fe0 100644 --- a/include/qemu/cutils.h +++ b/include/qemu/cutils.h @@ -1,6 +1,8 @@ #ifndef QEMU_CUTILS_H #define QEMU_CUTILS_H =20 +#include + #include "qemu/fprintf-fn.h" =20 /** diff --git a/include/qemu/fprintf-fn.h b/include/qemu/fprintf-fn.h index 9068a960b3..80361d87bf 100644 --- a/include/qemu/fprintf-fn.h +++ b/include/qemu/fprintf-fn.h @@ -8,6 +8,8 @@ #ifndef QEMU_FPRINTF_FN_H #define QEMU_FPRINTF_FN_H =20 +#include "compiler.h" + typedef int (*fprintf_function)(FILE *f, const char *fmt, ...) GCC_FMT_ATTR(2, 3); =20 diff --git a/tests/tcg/Makefile b/tests/tcg/Makefile index 89e3342f3d..0931ffa6c0 100644 --- a/tests/tcg/Makefile +++ b/tests/tcg/Makefile @@ -18,7 +18,7 @@ LDFLAGS=3D # also, pi_10.com runs indefinitely =20 I386_TESTS=3Dhello-i386 \ - linux-test \ + linux-test-i386 \ testthread \ sha1-i386 \ test-i386 \ @@ -47,7 +47,7 @@ run-%: % -$(QEMU) ./$* =20 run-hello-i386: hello-i386 -run-linux-test: linux-test +run-linux-test-i386: linux-test-i386 run-testthread: testthread run-sha1-i386: sha1-i386 =20 @@ -105,8 +105,11 @@ test-x86_64: test-i386.c \ $(CC_X86_64) $(QEMU_INCLUDES) $(CFLAGS) $(LDFLAGS) -o $@ $( #include #include +#include #include "qemu/cutils.h" =20 #define TESTPATH "/tmp/linux-test.tmp" @@ -107,6 +108,12 @@ void test_file(void) len =3D chk_error(write(fd, buf, FILE_BUF_SIZE / 2)); if (len !=3D (FILE_BUF_SIZE / 2)) error("write"); + len =3D chk_error(write(fd, buf, 0)); + if (len !=3D 0) + error("write 0 size"); + len =3D chk_error(write(fd, NULL, 0)); + if (len !=3D 0) + error("write NULL buf"); vecs[0].iov_base =3D buf + (FILE_BUF_SIZE / 2); vecs[0].iov_len =3D 16; vecs[1].iov_base =3D buf + (FILE_BUF_SIZE / 2) + 16; @@ -533,7 +540,7 @@ int main(int argc, char **argv) test_time(); test_socket(); // test_clone(); - test_signal(); + //test_signal(); test_shm(); return 0; } --=20 2.14.2