From nobody Mon Feb 9 06:49:05 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1600257711; cv=none; d=zohomail.com; s=zohoarc; b=LvwcGc3R7idFO3Kbo59cg5NsPw62kgZGNYJc/snT8Tv1kv9a3vfx8TRZ6sBLEdYOOSAVrq4Ne+LWtnIjcFL5AWQSX41m2oDrp8RG+KI0AJQwxhE7PNU70sbloN5IfF9X7mA8fGfX7EyfEq6b8Q4jVU7+6+9GTAS7PF9ePJQXjlA= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1600257711; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=08/OZLaHYaKtIXP4UD5zd+jhITM2zuxqFZNAPYjBMDc=; b=RnVnuqCJTPmgZiXBCSjGhSu0QeIOtvSb2OUmO3JavSviOWOc2z6dXOPbzW/117+7DbBjs3i0XKVUW4XN3An7lkjHkht1MaSoPKMxHAdD3zOnLsJudgt88/KG7gsH7p3K1TSKGbqz8N3RXQvXpvrDR7LhrnjE95DAHuf+ofh8T9g= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1600257711562433.0890180982086; Wed, 16 Sep 2020 05:01:51 -0700 (PDT) Received: from localhost ([::1]:49002 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kIW84-0001py-F2 for importer@patchew.org; Wed, 16 Sep 2020 08:01:40 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:54408) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kIVv1-0007G8-8c for qemu-devel@nongnu.org; Wed, 16 Sep 2020 07:48:11 -0400 Received: from us-smtp-delivery-124.mimecast.com ([63.128.21.124]:30495) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.90_1) (envelope-from ) id 1kIVuz-0008Ca-G7 for qemu-devel@nongnu.org; Wed, 16 Sep 2020 07:48:10 -0400 Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-398-rQqLPJ1dMcyMVqYKZeOeGw-1; Wed, 16 Sep 2020 07:48:06 -0400 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id CAE2910BBED7; Wed, 16 Sep 2020 11:48:05 +0000 (UTC) Received: from thuth.com (ovpn-113-19.ams2.redhat.com [10.36.113.19]) by smtp.corp.redhat.com (Postfix) with ESMTP id A184A5DA71; Wed, 16 Sep 2020 11:48:04 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1600256888; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=08/OZLaHYaKtIXP4UD5zd+jhITM2zuxqFZNAPYjBMDc=; b=LDjIlOPJIZiJOX1OOKeXp79+WG+WFnvbtCfzvKiyhO8tNi0o5bsZoSghwIu09xOQsG6sg1 P+acNylpmP8mRb7PzrJS/7WerrTVM4kIraWTQXr5M3kt8KTBgGJwZxZBMQsBjJaRlBdvt0 WfU2HfoFRNJNtxei7bPLsyc2x0utycQ= X-MC-Unique: rQqLPJ1dMcyMVqYKZeOeGw-1 From: Thomas Huth To: qemu-devel@nongnu.org, Peter Maydell Subject: [PULL 20/24] tests: Fixes test-io-channel-file by mask only owner file state mask bits Date: Wed, 16 Sep 2020 13:47:27 +0200 Message-Id: <20200916114731.102080-21-thuth@redhat.com> In-Reply-To: <20200916114731.102080-1-thuth@redhat.com> References: <20200916114731.102080-1-thuth@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.14 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=thuth@redhat.com X-Mimecast-Spam-Score: 0.003 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.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; Received-SPF: pass client-ip=63.128.21.124; envelope-from=thuth@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-detected-operating-system: by eggs.gnu.org: First seen = 2020/09/16 02:35:56 X-ACL-Warn: Detected OS = Linux 2.2.x-3.x [generic] [fuzzy] X-Spam_score_int: -50 X-Spam_score: -5.1 X-Spam_bar: ----- X-Spam_report: (-5.1 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-2.999, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H5=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Yonggang Luo Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: pass (identity @redhat.com) From: Yonggang Luo This is the error on msys2/mingw Running test test-io-channel-file ** ERROR:../tests/test-io-channel-file.c:59:test_io_channel_file_helper: asser= tion failed (TEST_MASK & ~mask =3D=3D st.st_mode & 0777): (384 =3D=3D 438) ERROR test-io-channel-file - Bail out! ERROR:../tests/test-io-channel-file.= c:59:test_io_channel_file_helper: assertion failed (TEST_MASK & ~mask =3D= =3D st.st_mode & 0777): (384 =3D=3D 438) Signed-off-by: Yonggang Luo Reviewed-by: Daniel P. Berrang=C3=A9 Message-Id: <20200915171234.236-20-luoyonggang@gmail.com> Signed-off-by: Thomas Huth --- tests/test-io-channel-file.c | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/tests/test-io-channel-file.c b/tests/test-io-channel-file.c index bac2b07562..0aa0477541 100644 --- a/tests/test-io-channel-file.c +++ b/tests/test-io-channel-file.c @@ -28,6 +28,16 @@ #define TEST_FILE "tests/test-io-channel-file.txt" #define TEST_MASK 0600 =20 +/* + * On Windows the stat() function in the C library checks only + * the FAT-style READONLY attribute and does not look at the ACL at all. + */ +#ifdef _WIN32 +#define TEST_MASK_EXPECT 0700 +#else +#define TEST_MASK_EXPECT 0777 +#endif + static void test_io_channel_file_helper(int flags) { QIOChannel *src, *dst; @@ -56,7 +66,7 @@ static void test_io_channel_file_helper(int flags) umask(mask); ret =3D stat(TEST_FILE, &st); g_assert_cmpint(ret, >, -1); - g_assert_cmpuint(TEST_MASK & ~mask, =3D=3D, st.st_mode & 0777); + g_assert_cmpuint(TEST_MASK & ~mask, =3D=3D, st.st_mode & TEST_MASK_EXP= ECT); =20 unlink(TEST_FILE); object_unref(OBJECT(src)); --=20 2.18.2