Browse Source

Check sizeof(time_t) before running the time overflow test.

git-svn-id: svn://bind10.isc.org/svn/bind10/trunk@1367 e5f2f494-b856-4b98-b285-d166d9295462
Evan Hunt 15 years ago
parent
commit
63ce80bca2
1 changed files with 8 additions and 2 deletions
  1. 8 2
      src/lib/dns/tests/dnssectime_unittest.cc

+ 8 - 2
src/lib/dns/tests/dnssectime_unittest.cc

@@ -61,8 +61,14 @@ TEST(DNSSECTimeTest, toText)
 {
     EXPECT_EQ("19700101000000", timeToText(0));
     EXPECT_EQ("20100311233000", timeToText(1268350200));
+}
 
-    // Jan 1, Year 10,000.  What should we do?
-    //EXPECT_THROW(timeToText(253402300800LL), InvalidTime);
+TEST(DNSSECTimeTest, overflow)
+{
+    // Jan 1, Year 10,000.
+    if (sizeof(time_t) > 4) {
+        EXPECT_THROW(timeToText(253402300800LL), InvalidTime);
+    }
 }
+
 }