Skip to contentSkip to conversation

fix tests

PATCH In review Gerd Hoffmann 2 participants 4 messages Jan 7, 2013

lore
Share & tools
lore
#1 lore raw

PATCH 1/2 rtc-test: skip year-2038 overflow check in case time_t is 32bit only

In reply to Gerd Hoffmann
---
 tests/rtc-test.c |    4 ++++
 1 files changed, 4 insertions(+), 0 deletions(-)
tests/rtc-test.c +4 -0
index 02edbf5..e7123ca 100644
@@ -201,6 +201,10 @@ static void set_year_20xx(void)
     g_assert_cmpint(cmos_read(RTC_YEAR), ==, 0x11);
     g_assert_cmpint(cmos_read(RTC_CENTURY), ==, 0x20);
 
+    if (sizeof(time_t) == 4) {
+        return;
+    }
+
     /* Set a date in 2080 to ensure there is no year-2038 overflow.  */
     cmos_write(RTC_REG_A, 0x76);
     cmos_write(RTC_YEAR, 0x80);
Signature · 1 line
1.7.1
#3 lore raw

PATCH 2/2 m48t59-test: don't touch watchdog

In reply to Gerd Hoffmann
---
 tests/m48t59-test.c |    5 +++++
 1 files changed, 5 insertions(+), 0 deletions(-)
tests/m48t59-test.c +5 -0
index 5179681..d79f554 100644
@@ -233,6 +233,11 @@ static void fuzz_registers(void)
         reg = (uint8_t)g_test_rand_int_range(0, 16);
         val = (uint8_t)g_test_rand_int_range(0, 256);
 
+        if (reg == 7) {
+            /* watchdog setup register, may trigger system reset, skip */
+            continue;
+        }
+
         cmos_write(reg, val);
         cmos_read(reg);
     }
Signature · 1 line
1.7.1
#0 lore raw

cover fix tests

Hi,

Two little test case fixes so "make check" passes.

cheers,
Gerd

Gerd Hoffmann (2):
rtc-test: skip year-2038 overflow check in case time_t is 32bit only
m48t59-test: don't touch watchdog

 tests/m48t59-test.c |    5 +++++
 tests/rtc-test.c    |    4 ++++
 2 files changed, 9 insertions(+), 0 deletions(-)
Reviewed-by on v1 1/2
#2 lore raw

Re: [Qemu-devel] [PATCH 1/2] rtc-test: skip year-2038 overflow check in case time_t is 32bit only

In reply to Gerd Hoffmann

Am 07.01.2013 15:11, schrieb Gerd Hoffmann:

Quoted 1 line

Andreas

Signature · 2 lines
SUSE LINUX Products GmbH, Maxfeldstr. 5, 90409 Nürnberg, Germany
GF: Jeff Hawn, Jennifer Guild, Felix Imendörffer; HRB 16746 AG Nürnberg