mirror of
https://github.com/GothenburgBitFactory/taskwarrior.git
synced 2025-06-26 10:54:26 +02:00
Check Datetime addition when performing recurrence (#3708)
This commit is contained in:
parent
0b286460b6
commit
4797c4e17e
3 changed files with 47 additions and 6 deletions
|
@ -33,6 +33,7 @@
|
|||
#include <util.h>
|
||||
|
||||
#include <iostream>
|
||||
#include <limits>
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
int TEST_NAME(int, char**) {
|
||||
|
@ -91,6 +92,12 @@ int TEST_NAME(int, char**) {
|
|||
t.ok(nontrivial(" \t\ta"), "nontrivial ' \\t\\ta' -> true");
|
||||
t.ok(nontrivial("a\t\t "), "nontrivial 'a\\t\\t ' -> true");
|
||||
|
||||
Datetime dt(1234526400);
|
||||
Datetime max(std::numeric_limits<time_t>::max());
|
||||
t.ok(checked_add_datetime(dt, 10).has_value(), "small delta");
|
||||
t.ok(!checked_add_datetime(dt, 0x100000000).has_value(), "delta > 32bit");
|
||||
t.ok(!checked_add_datetime(max, 1).has_value(), "huge base time");
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue