From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:47280) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1drRgx-0000Yz-SZ for qemu-devel@nongnu.org; Mon, 11 Sep 2017 12:36:12 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1drRgt-00038r-Rc for qemu-devel@nongnu.org; Mon, 11 Sep 2017 12:36:11 -0400 Received: from mx0b-001b2d01.pphosted.com ([148.163.158.5]:41656 helo=mx0a-001b2d01.pphosted.com) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1drRgt-00038f-Me for qemu-devel@nongnu.org; Mon, 11 Sep 2017 12:36:07 -0400 Received: from pps.filterd (m0098417.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.16.0.21/8.16.0.21) with SMTP id v8BGZSXA042357 for ; Mon, 11 Sep 2017 12:36:06 -0400 Received: from e06smtp14.uk.ibm.com (e06smtp14.uk.ibm.com [195.75.94.110]) by mx0a-001b2d01.pphosted.com with ESMTP id 2cwsg0vrg8-1 (version=TLSv1.2 cipher=AES256-SHA bits=256 verify=NOT) for ; Mon, 11 Sep 2017 12:36:05 -0400 Received: from localhost by e06smtp14.uk.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Mon, 11 Sep 2017 17:36:03 +0100 References: <20170905111645.18068-1-pasic@linux.vnet.ibm.com> <20170905111645.18068-2-pasic@linux.vnet.ibm.com> <20170906141846.0be413fb.cohuck@redhat.com> <20170906145158.252cf0cd.cohuck@redhat.com> From: Halil Pasic Date: Mon, 11 Sep 2017 18:36:00 +0200 MIME-Version: 1.0 In-Reply-To: <20170906145158.252cf0cd.cohuck@redhat.com> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 8bit Message-Id: <27c027c4-58b4-9031-648e-9fd2fa1e5fa8@linux.vnet.ibm.com> Subject: Re: [Qemu-devel] [PATCH 1/5] s390x/css: introduce css data stream List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Cornelia Huck Cc: Dong Jia Shi , Pierre Morel , qemu-devel@nongnu.org On 09/06/2017 02:51 PM, Cornelia Huck wrote: >>>> +void ccw_dstream_init(CcwDataStream *cds, CCW1 const *ccw, ORB const *orb) >>>> +{ >>>> + /* >>>> + * We don't support MIDA (an optional facility) yet and we >>>> + * catch this earlier. Just for expressing the precondition. >>>> + */ >>>> + assert(!(orb->ctrl1 & ORB_CTRL1_MASK_MIDAW)); >>> I don't know, this is infrastructure, should it trust its callers? If >>> you keep the assert, please make it g_assert(). >> >> Why g_assert? I think g_assert comes form a test framework, this is not >> test code. > g_assert() is glib, no? > It lives in GLib > GLib Utilities > Testing: https://developer.gnome.org/glib/stable/glib-Testing.html The description of "Testing" starts like this: "GLib provides a framework for writing and maintaining unit tests in parallel to the code they are testing. The API is designed according to established concepts found in the other test frameworks (JUnit, NUnit, RUnit), which in turn is based on smalltalk unit testing concepts." So yes, it's both glib and testing framework. This is why I ask why should one use g_assert in not-unit-test code. Halil