From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:51482) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TivYV-0003qd-Ad for qemu-devel@nongnu.org; Wed, 12 Dec 2012 18:17:37 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1TivYU-0002Yp-0p for qemu-devel@nongnu.org; Wed, 12 Dec 2012 18:17:35 -0500 Received: from mout.web.de ([212.227.15.4]:63134) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TivYT-0002Yh-O9 for qemu-devel@nongnu.org; Wed, 12 Dec 2012 18:17:33 -0500 Message-ID: <50C9108A.9000302@web.de> Date: Thu, 13 Dec 2012 00:17:30 +0100 From: =?UTF-8?B?QW5kcmVhcyBGw6RyYmVy?= MIME-Version: 1.0 References: <1355293773-18361-1-git-send-email-andreas.faerber@web.de> <1355293773-18361-3-git-send-email-andreas.faerber@web.de> In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Subject: Re: [Qemu-devel] [PATCH 2/2] tests: Add tmp105 unit test List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Blue Swirl Cc: Alex Horn , qemu-devel@nongnu.org, Anthony Liguori , Peter Maydell Am 12.12.2012 20:43, schrieb Blue Swirl: > On Wed, Dec 12, 2012 at 6:29 AM, Andreas Färber wrote: >> +static void omap_i2c_send(uint8_t addr, const void *buf, uint16_t len) > > With const uint8_t *buf you could avoid a few casts below. Good idea, thanks. I was working with other data types before, where void* saved casts. >> + qtest_add_func("/tmp105/tx-rx", send_and_receive); > > A register fuzzing test (like rtc-test.c) would be nice too. I'm aware of your register fuzzing tests. However we do not directly access registers of the tmp105, so those should go into an omap_i2c-test.c file instead if someone wants to ever test that implementation. Alex H. has pointed to some more real-world test cases which I'd invite him to add here as follow-ups. My quest for tonight will be to generalize the I2C API for libqos by comparing the tegra_i2c implementation. I hope my omap_i2c_* API is pretty close already if we add one parameter for an adapter struct. Andreas