Module: xenomai-forge
Branch: next
Commit: 417cfcf09a3f71104d8010abdbee131ece3bffd9
URL:    
http://git.xenomai.org/?p=xenomai-forge.git;a=commit;h=417cfcf09a3f71104d8010abdbee131ece3bffd9

Author: Philippe Gerum <r...@xenomai.org>
Date:   Mon Jun 30 21:31:33 2014 +0200

testsuite/regression: fix potential integer overflow

---

 testsuite/regression/posix/clock_settime.c |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/testsuite/regression/posix/clock_settime.c 
b/testsuite/regression/posix/clock_settime.c
index 5168ea1..236cc93 100644
--- a/testsuite/regression/posix/clock_settime.c
+++ b/testsuite/regression/posix/clock_settime.c
@@ -145,7 +145,7 @@ static void 
clock_decrease_before_oneshot_timer_first_tick(void)
        check_unix(clock_gettime(CLOCK_MONOTONIC, &now));
        diff = now.tv_sec * 1000000000ULL + now.tv_nsec -
                (timer.it_value.tv_sec * 1000000000ULL + 
timer.it_value.tv_nsec);
-       assert(diff >= 5500000000 && diff <= 6500000000);
+       assert(diff >= 5500000000LL && diff <= 6500000000LL);
        check_unix(close(t));
 }
 
@@ -173,7 +173,7 @@ static void 
clock_decrease_before_periodic_timer_first_tick(void)
        check_unix(clock_gettime(CLOCK_MONOTONIC, &now));
        diff = now.tv_sec * 1000000000ULL + now.tv_nsec -
                (timer.it_value.tv_sec * 1000000000ULL + 
timer.it_value.tv_nsec);
-       assert(diff >= 5500000000 && diff <= 6500000000);
+       assert(diff >= 5500000000LL && diff <= 6500000000LL);
        check_unix(read(t, &ticks, sizeof(ticks)));
        assert(ticks == 1);
        check_unix(close(t));


_______________________________________________
Xenomai-git mailing list
Xenomai-git@xenomai.org
http://www.xenomai.org/mailman/listinfo/xenomai-git

Reply via email to