From dd10bf52e760084bc920950d0e336af74ca797c2 Mon Sep 17 00:00:00 2001 From: Federico Hernandez Date: Tue, 28 Dec 2010 22:33:18 +0100 Subject: [PATCH] Unit tests: - TZ related bug in date.t.cpp (test 78). 1234567890 is 2/14 in CET. Changed epoch to 1234526400 which is 2/13/2009 12:00:00 UTC. --- test/date.t.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/test/date.t.cpp b/test/date.t.cpp index 72d55d1a1..4735cc2e3 100644 --- a/test/date.t.cpp +++ b/test/date.t.cpp @@ -161,11 +161,11 @@ int main (int argc, char** argv) t.is (iso.toISO (), "20010909T014640Z", "1,000,000,000 -> 20010909T014640Z"); // Quantization. - Date quant (1234567890); - t.is (quant.startOfDay ().toString ("YMDHNS"), "20090213000000", "1234567890 -> 2/13/2009 18:31:30 -> 2/13/2009 0:00:00"); - t.is (quant.startOfWeek ().toString ("YMDHNS"), "20090208000000", "1234567890 -> 2/13/2009 18:31:30 -> 2/8/2009 0:00:00"); - t.is (quant.startOfMonth ().toString ("YMDHNS"), "20090201000000", "1234567890 -> 2/13/2009 18:31:30 -> 2/1/2009 0:00:00"); - t.is (quant.startOfYear ().toString ("YMDHNS"), "20090101000000", "1234567890 -> 2/13/2009 18:31:30 -> 1/1/2009 0:00:00"); + Date quant (1234526400); + t.is (quant.startOfDay ().toString ("YMDHNS"), "20090213000000", "1234526400 -> 2/13/2009 12:00:00 UTC -> 2/13/2009 0:00:00"); + t.is (quant.startOfWeek ().toString ("YMDHNS"), "20090208000000", "1234526400 -> 2/13/2009 12:00:00 UTC -> 2/8/2009 0:00:00"); + t.is (quant.startOfMonth ().toString ("YMDHNS"), "20090201000000", "1234526400 -> 2/13/2009 12:00:00 UTC -> 2/1/2009 0:00:00"); + t.is (quant.startOfYear ().toString ("YMDHNS"), "20090101000000", "1234526400 -> 2/13/2009 12:00:00 UTC -> 1/1/2009 0:00:00"); // Date parsing. Date fromString1 ("1/1/2008");