]> git.proxmox.com Git - ceph.git/blobdiff - ceph/src/boost/libs/date_time/test/gregorian/testgreg_durations.cpp
update sources to v12.2.3
[ceph.git] / ceph / src / boost / libs / date_time / test / gregorian / testgreg_durations.cpp
index 67bf99d58e9d2f4c08d06f440776d93dd0b266e3..c1d056e99711630525a3371cc36ddbeccfb47ffa 100644 (file)
@@ -156,6 +156,24 @@ int main(){
       check("date -= years", date(1994, Feb, 28) == d);
     }
 
+    try {
+      date d1(1400, 6, 1);
+      const date d2 = d1 + years(8600);
+      check("date + many years != overflow", d2 == date(10000, 6, 1));
+    }
+    catch (...) {
+      check("date + many years != overflow", false);
+    }
+
+    try {
+      date d1(10000, 6, 1);
+      const date d2 = d1 - years(8600);
+      check("date - many years != overflow", d2 == date(1400, 6, 1));
+    }
+    catch (...) {
+      check("date - many years != overflow", false);
+    }
+
   }
   
   /*** weeks ***/