diff options
author | Paul Eggert <eggert@cs.ucla.edu> | 2015-11-05 17:41:43 -0800 |
---|---|---|
committer | Paul Eggert <eggert@cs.ucla.edu> | 2015-11-05 17:43:20 -0800 |
commit | 051613c240910cacdd83cb4f6a431f5435124243 (patch) | |
tree | 1c8a74f1313ea074db08760fd333abe71841fdca /modules/timespec-tests | |
parent | ca64874789ae1a4932ff547a52d816c4bea91f62 (diff) | |
download | gnulib-051613c240910cacdd83cb4f6a431f5435124243.tar.gz |
timespec-sub: fix overflow bug; add tests
* lib/timespec-add.c (timespec_add):
* lib/timespec-sub.c (timespec_sub):
Work even if time_t is narrower than int (a theoretical
possibility). Redo code for a bit more clarity.
* lib/timespec-sub.c (timespec_sub):
Fix off-by-2 bug if a.tv_sec == TYPE_MINIMUM (time_t) and 0 < b.tv_sec.
* modules/timespec-tests, tests/test-timespec.c: New files.
Diffstat (limited to 'modules/timespec-tests')
-rw-r--r-- | modules/timespec-tests | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/modules/timespec-tests b/modules/timespec-tests new file mode 100644 index 0000000000..ecd0dae4fd --- /dev/null +++ b/modules/timespec-tests @@ -0,0 +1,16 @@ +Files: +tests/test-timespec.c +tests/macros.h + +Depends-on: +dtotimespec +intprops +stdbool +timespec-add +timespec-sub + +configure.ac: + +Makefile.am: +TESTS += test-timespec +check_PROGRAMS += test-timespec |