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

Submitted by Gerd Hoffmann on Jan. 10, 2013, 2:49 p.m.

Details

Message ID 1357829380-17599-2-git-send-email-kraxel@redhat.com
State New
Headers show

Commit Message

Gerd Hoffmann Jan. 10, 2013, 2:49 p.m.
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
---
 tests/rtc-test.c |    4 ++++
 1 files changed, 4 insertions(+), 0 deletions(-)

Comments

Andreas Färber Jan. 10, 2013, 3:03 p.m.
Am 10.01.2013 15:49, schrieb Gerd Hoffmann:
> Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>

Where did my Reviewed-by go? :)

Andreas

> ---
>  tests/rtc-test.c |    4 ++++
>  1 files changed, 4 insertions(+), 0 deletions(-)
> 
> diff --git a/tests/rtc-test.c b/tests/rtc-test.c
> index 02edbf5..e7123ca 100644
> --- a/tests/rtc-test.c
> +++ b/tests/rtc-test.c
> @@ -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);
>
Gerd Hoffmann Jan. 11, 2013, 7:55 a.m.
On 01/10/13 16:03, Andreas Färber wrote:
> Am 10.01.2013 15:49, schrieb Gerd Hoffmann:
>> Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
> 
> Where did my Reviewed-by go? :)

Anyone happens to have a script to pick up those?

thanks,
  Gerd

Patch hide | download patch | download mbox

diff --git a/tests/rtc-test.c b/tests/rtc-test.c
index 02edbf5..e7123ca 100644
--- a/tests/rtc-test.c
+++ b/tests/rtc-test.c
@@ -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);