From: Michal 'vorner' Vaner Date: Wed, 7 Nov 2012 09:01:56 +0000 (+0100) Subject: [2384] Test case of reused unit X-Git-Tag: trac2487_base~1^2~29^2~2^2~13 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=cc44ed781d1d4affac1ccfbeedb9ec29f7e138a0;p=thirdparty%2Fkea.git [2384] Test case of reused unit --- diff --git a/src/lib/dns/tests/rrttl_unittest.cc b/src/lib/dns/tests/rrttl_unittest.cc index bf73c3afd9..4d8939720c 100644 --- a/src/lib/dns/tests/rrttl_unittest.cc +++ b/src/lib/dns/tests/rrttl_unittest.cc @@ -105,6 +105,9 @@ TEST_F(RRTTLTest, fromTextUnit) { EXPECT_EQ(60 * 60 + 3, RRTTL("1H3S").getValue()); EXPECT_EQ(2 * 24 * 60 * 60 + 75 * 60 + 4, RRTTL("75M2D4").getValue()); + // Awkward, but allowed case - the same unit used twice. + EXPECT_EQ(20 * 3600, RRTTL("12H8H").getValue()); + // Missing before unit. EXPECT_THROW(RRTTL("W5H"), InvalidRRTTL); EXPECT_THROW(RRTTL("5hW"), InvalidRRTTL);