From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from [87.239.111.99] (localhost [127.0.0.1]) by dev.tarantool.org (Postfix) with ESMTP id F368A6EC40; Mon, 16 Aug 2021 03:00:27 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 dev.tarantool.org F368A6EC40 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=tarantool.org; s=dev; t=1629072028; bh=DosvMJwPmw1sR4iWrbKg2fXXTGdwMIFSs5hItbheQTU=; h=To:Date:In-Reply-To:References:Subject:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To: From; b=Y/lH9w2Z+3GsUeYnQkIMeJHogMnxzz7a68WKHVggtY+vCvRIm6iQyncZaHYf2FyF4 LNPxZc2WeHKem9P6lOMDCbYigcerID5PAmqLcGlcpf11E6Wh07vSYq0vtivmJ8T3JT nCWez1DT+bwIQ16CG6xaPyKWQh8blWE2N4tl6uFA= Received: from smtp41.i.mail.ru (smtp41.i.mail.ru [94.100.177.101]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dev.tarantool.org (Postfix) with ESMTPS id 5A17A6EC40 for ; Mon, 16 Aug 2021 02:59:58 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 dev.tarantool.org 5A17A6EC40 Received: by smtp41.i.mail.ru with esmtpa (envelope-from ) id 1mFQ2m-00047O-GY; Mon, 16 Aug 2021 02:59:57 +0300 To: v.shpilevoy@tarantool.org, imun@tarantool.org, imeevma@tarantool.org, tarantool-patches@dev.tarantool.org Date: Mon, 16 Aug 2021 02:59:35 +0300 Message-Id: <25f9e4a85319d7b4d1fa4fe70d9e9fb30b43c78d.1629071531.git.tsafin@tarantool.org> X-Mailer: git-send-email 2.29.2 In-Reply-To: References: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-4EC0790: 10 X-7564579A: B8F34718100C35BD X-77F55803: 4F1203BC0FB41BD92087353F0EC44DD9D5AC6413C25DCF08CC98B8FCC5CD86F3182A05F53808504009709A67D63F40C0D9B4DE9410C8E42C5F252E8B006B17E565758CAFD9171CA2 X-7FA49CB5: FF5795518A3D127A4AD6D5ED66289B5278DA827A17800CE779AAD18609327F83EA1F7E6F0F101C67BD4B6F7A4D31EC0BCC500DACC3FED6E28638F802B75D45FF8AA50765F79006371D26D2A8652661258638F802B75D45FF36EB9D2243A4F8B5A6FCA7DBDB1FC311F39EFFDF887939037866D6147AF826D89ED3668B615B1B005F1E906893BA8A99117882F4460429724CE54428C33FAD305F5C1EE8F4F765FCAA867293B0326636D2E47CDBA5A96583BD4B6F7A4D31EC0BC014FD901B82EE079FA2833FD35BB23D27C277FBC8AE2E8BF1175FABE1C0F9B6A471835C12D1D977C4224003CC836476EB9C4185024447017B076A6E789B0E975F5C1EE8F4F765FC71F6FC3C62FD56E63AA81AA40904B5D9CF19DD082D7633A078D18283394535A93AA81AA40904B5D98AA50765F790063755005259B6E2CF39D81D268191BDAD3D698AB9A7B718F8C4D1B931868CE1C5781A620F70A64A45A98AA50765F79006372E808ACE2090B5E1725E5C173C3A84C3C5EA940A35A165FF2DBA43225CD8A89FB26E97DCB74E6252156CCFE7AF13BCA4B5C8C57E37DE458BEDA766A37F9254B7 X-B7AD71C0: AC4F5C86D027EB782CDD5689AFBDA7A213B5FB47DCBC3458F0AFF96BAACF4158235E5A14AD4A4A4625E192CAD1D9E79D0B18DC6AC13D9A1CE7229BD54570362A X-C1DE0DAB: C20DE7B7AB408E4181F030C43753B8186998911F362727C414F749A5E30D975C5B73F950BC6E7FFB167659F7779B33BDF89B744DA3FF85B49C2B6934AE262D3EE7EAB7254005DCED7532B743992DF240BDC6A1CF3F042BAD6DF99611D93F60EFE37876E7723AB534DC48ACC2A39D04F89CDFB48F4795C241BDAD6C7F3747799A X-C8649E89: 4E36BF7865823D7055A7F0CF078B5EC49A30900B95165D343F22CE0A71FDB37E3151045B17DE34FCCA40A55CCC35843D780D091A513E027B448CBB7B4BDF16E61D7E09C32AA3244C396EF1492C55A8545D1C0B63F17F5F679CA7333006C390A08D5DD81C2BAB7D1D X-D57D3AED: 3ZO7eAau8CL7WIMRKs4sN3D3tLDjz0dLbV79QFUyzQ2Ujvy7cMT6pYYqY16iZVKkSc3dCLJ7zSJH7+u4VD18S7Vl4ZUrpaVfd2+vE6kuoey4m4VkSEu530nj6fImhcD4MUrOEAnl0W826KZ9Q+tr5ycPtXkTV4k65bRjmOUUP8cvGozZ33TWg5HZplvhhXbhDGzqmQDTd6OAevLeAnq3Ra9uf7zvY2zzsIhlcp/Y7m53TZgf2aB4JOg4gkr2biojVT2don9h9KoGlV40Aa16SQ== X-Mailru-Sender: B5B6A6EBBD94DAD833E4B9A85F720031806AC487ADECA3543FF7673963E54AE2362B97A6382F60D91EC9E4A2C82A33BC8C24925A86E657CE0C70AEE3C9A96FBAB3D7EE8ED63280BE112434F685709FCF0DA7A0AF5A3A8387 X-Mras: Ok Subject: [Tarantool-patches] [PATCH v5 1/8] build: add Christian Hansen c-dt to the build X-BeenThere: tarantool-patches@dev.tarantool.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Tarantool development patches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , From: Timur Safin via Tarantool-patches Reply-To: Timur Safin Errors-To: tarantool-patches-bounces@dev.tarantool.org Sender: "Tarantool-patches" * Integrated chansen/c-dt parser as 3rd party module to the Tarantool cmake build process; * Points to tarantool/c-dt instead of original chansen/c-dt to have easier build integration, because there are additional commits which have integrated cmake support and have established symbols renaming facilities (similar to those we see in xxhash or icu). We have to be able to rename externally public symbols to avoid name clashes with 3rd party modules. We prefix c-dt symbols in the Tarantool build with `tnt_` prefix; * took special care that generated build artifacts not override in-source files, but use different build/ directory. * added datetime parsing unit tests, for literals - with and without trailing timezones; * also we check that strftime is reversible and produce consistent results after roundtrip from/to strings; * discovered the harder way that on *BSD/MacOSX `strftime()` format `%z` outputs local time-zone if passed `tm_gmtoff` is 0. This behaviour is different to that we observed on Linux, thus we might have different execution results. Made test to not use `%z` and only operate with normalized date time formats `%F` and `%T` Part of #5941 --- .gitmodules | 3 + CMakeLists.txt | 8 + cmake/BuildCDT.cmake | 8 + src/CMakeLists.txt | 3 +- test/unit/CMakeLists.txt | 3 +- test/unit/datetime.c | 223 ++++++++++++++++++++++++ test/unit/datetime.result | 358 ++++++++++++++++++++++++++++++++++++++ third_party/c-dt | 1 + 8 files changed, 605 insertions(+), 2 deletions(-) create mode 100644 cmake/BuildCDT.cmake create mode 100644 test/unit/datetime.c create mode 100644 test/unit/datetime.result create mode 160000 third_party/c-dt diff --git a/.gitmodules b/.gitmodules index f2f91ee72..aa3fbae4e 100644 --- a/.gitmodules +++ b/.gitmodules @@ -43,3 +43,6 @@ [submodule "third_party/xxHash"] path = third_party/xxHash url = https://github.com/tarantool/xxHash +[submodule "third_party/c-dt"] + path = third_party/c-dt + url = https://github.com/tarantool/c-dt.git diff --git a/CMakeLists.txt b/CMakeLists.txt index e25b81eac..53c86f2a5 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -571,6 +571,14 @@ endif() # zstd # +# +# Chritian Hanson c-dt +# + +include(BuildCDT) +libccdt_build() +add_dependencies(build_bundled_libs cdt) + # # Third-Party misc # diff --git a/cmake/BuildCDT.cmake b/cmake/BuildCDT.cmake new file mode 100644 index 000000000..343fb1b99 --- /dev/null +++ b/cmake/BuildCDT.cmake @@ -0,0 +1,8 @@ +macro(libccdt_build) + set(LIBCDT_INCLUDE_DIRS ${PROJECT_SOURCE_DIR}/third_party/c-dt/) + set(LIBCDT_LIBRARIES cdt) + + file(MAKE_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/third_party/c-dt/build/) + add_subdirectory(${PROJECT_SOURCE_DIR}/third_party/c-dt + ${CMAKE_CURRENT_BINARY_DIR}/third_party/c-dt/build/) +endmacro() diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index adb03b3f4..97b0cb326 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -193,7 +193,8 @@ target_link_libraries(server core coll http_parser bit uri uuid swim swim_udp # Rule of thumb: if exporting a symbol from a static library, list the # library here. set (reexport_libraries server core misc bitset csv swim swim_udp swim_ev - shutdown ${LUAJIT_LIBRARIES} ${MSGPUCK_LIBRARIES} ${ICU_LIBRARIES} ${CURL_LIBRARIES} ${XXHASH_LIBRARIES}) + shutdown ${LUAJIT_LIBRARIES} ${MSGPUCK_LIBRARIES} ${ICU_LIBRARIES} + ${CURL_LIBRARIES} ${XXHASH_LIBRARIES} ${LIBCDT_LIBRARIES}) set (common_libraries ${reexport_libraries} diff --git a/test/unit/CMakeLists.txt b/test/unit/CMakeLists.txt index 5bb7cd6e7..31b183a8f 100644 --- a/test/unit/CMakeLists.txt +++ b/test/unit/CMakeLists.txt @@ -56,7 +56,8 @@ add_executable(uuid.test uuid.c core_test_utils.c) target_link_libraries(uuid.test uuid unit) add_executable(random.test random.c core_test_utils.c) target_link_libraries(random.test core unit) - +add_executable(datetime.test datetime.c) +target_link_libraries(datetime.test cdt unit) add_executable(bps_tree.test bps_tree.cc) target_link_libraries(bps_tree.test small misc) add_executable(bps_tree_iterator.test bps_tree_iterator.cc) diff --git a/test/unit/datetime.c b/test/unit/datetime.c new file mode 100644 index 000000000..64c19dac4 --- /dev/null +++ b/test/unit/datetime.c @@ -0,0 +1,223 @@ +#include "dt.h" +#include +#include +#include +#include + +#include "unit.h" + +static const char sample[] = "2012-12-24T15:30Z"; + +#define S(s) {s, sizeof(s) - 1} +struct { + const char * sz; + size_t len; +} tests[] = { + S("2012-12-24 15:30Z"), + S("2012-12-24 15:30z"), + S("2012-12-24 15:30"), + S("2012-12-24 16:30+01:00"), + S("2012-12-24 16:30+0100"), + S("2012-12-24 16:30+01"), + S("2012-12-24 14:30-01:00"), + S("2012-12-24 14:30-0100"), + S("2012-12-24 14:30-01"), + S("2012-12-24 15:30:00Z"), + S("2012-12-24 15:30:00z"), + S("2012-12-24 15:30:00"), + S("2012-12-24 16:30:00+01:00"), + S("2012-12-24 16:30:00+0100"), + S("2012-12-24 14:30:00-01:00"), + S("2012-12-24 14:30:00-0100"), + S("2012-12-24 15:30:00.123456Z"), + S("2012-12-24 15:30:00.123456z"), + S("2012-12-24 15:30:00.123456"), + S("2012-12-24 16:30:00.123456+01:00"), + S("2012-12-24 16:30:00.123456+01"), + S("2012-12-24 14:30:00.123456-01:00"), + S("2012-12-24 14:30:00.123456-01"), + S("2012-12-24t15:30Z"), + S("2012-12-24t15:30z"), + S("2012-12-24t15:30"), + S("2012-12-24t16:30+01:00"), + S("2012-12-24t16:30+0100"), + S("2012-12-24t14:30-01:00"), + S("2012-12-24t14:30-0100"), + S("2012-12-24t15:30:00Z"), + S("2012-12-24t15:30:00z"), + S("2012-12-24t15:30:00"), + S("2012-12-24t16:30:00+01:00"), + S("2012-12-24t16:30:00+0100"), + S("2012-12-24t14:30:00-01:00"), + S("2012-12-24t14:30:00-0100"), + S("2012-12-24t15:30:00.123456Z"), + S("2012-12-24t15:30:00.123456z"), + S("2012-12-24t16:30:00.123456+01:00"), + S("2012-12-24t14:30:00.123456-01:00"), + S("2012-12-24 16:30 +01:00"), + S("2012-12-24 14:30 -01:00"), + S("2012-12-24 15:30 UTC"), + S("2012-12-24 16:30 UTC+1"), + S("2012-12-24 16:30 UTC+01"), + S("2012-12-24 16:30 UTC+0100"), + S("2012-12-24 16:30 UTC+01:00"), + S("2012-12-24 14:30 UTC-1"), + S("2012-12-24 14:30 UTC-01"), + S("2012-12-24 14:30 UTC-01:00"), + S("2012-12-24 14:30 UTC-0100"), + S("2012-12-24 15:30 GMT"), + S("2012-12-24 16:30 GMT+1"), + S("2012-12-24 16:30 GMT+01"), + S("2012-12-24 16:30 GMT+0100"), + S("2012-12-24 16:30 GMT+01:00"), + S("2012-12-24 14:30 GMT-1"), + S("2012-12-24 14:30 GMT-01"), + S("2012-12-24 14:30 GMT-01:00"), + S("2012-12-24 14:30 GMT-0100"), + S("2012-12-24 14:30 -01:00"), + S("2012-12-24 16:30:00 +01:00"), + S("2012-12-24 14:30:00 -01:00"), + S("2012-12-24 16:30:00.123456 +01:00"), + S("2012-12-24 14:30:00.123456 -01:00"), + S("2012-12-24 15:30:00.123456 -00:00"), + S("20121224T1630+01:00"), + S("2012-12-24T1630+01:00"), + S("20121224T16:30+01"), + S("20121224T16:30 +01"), +}; +#undef S + +#define DIM(a) (sizeof(a) / sizeof(a[0])) + +/* p5-time-moment/src/moment_parse.c: parse_string_lenient() */ +static int +parse_datetime(const char *str, size_t len, int64_t *sp, int32_t *np, + int32_t *op) +{ + size_t n; + dt_t dt; + char c; + int sod = 0, nanosecond = 0, offset = 0; + + n = dt_parse_iso_date(str, len, &dt); + if (!n) + return 1; + if (n == len) + goto exit; + + c = str[n++]; + if (!(c == 'T' || c == 't' || c == ' ')) + return 1; + + str += n; + len -= n; + + n = dt_parse_iso_time(str, len, &sod, &nanosecond); + if (!n) + return 1; + if (n == len) + goto exit; + + if (str[n] == ' ') + n++; + + str += n; + len -= n; + + n = dt_parse_iso_zone_lenient(str, len, &offset); + if (!n || n != len) + return 1; + +exit: + *sp = ((int64_t)dt_rdn(dt) - 719163) * 86400 + sod - offset * 60; + *np = nanosecond; + *op = offset; + + return 0; +} + +/* avoid introducing external datetime.h dependency - + just copy paste it for today +*/ +#define SECS_PER_DAY 86400 +#define DT_EPOCH_1970_OFFSET 719163 + +struct datetime { + double secs; + int32_t nsec; + int32_t offset; +}; + +static int +local_rd(const struct datetime *dt) +{ + return (int)((int64_t)dt->secs / SECS_PER_DAY) + DT_EPOCH_1970_OFFSET; +} + +static int +local_dt(const struct datetime *dt) +{ + return dt_from_rdn(local_rd(dt)); +} + +struct tm * +datetime_to_tm(struct datetime *dt) +{ + static struct tm tm; + + memset(&tm, 0, sizeof(tm)); + dt_to_struct_tm(local_dt(dt), &tm); + + int seconds_of_day = (int64_t)dt->secs % 86400; + tm.tm_hour = (seconds_of_day / 3600) % 24; + tm.tm_min = (seconds_of_day / 60) % 60; + tm.tm_sec = seconds_of_day % 60; + + return &tm; +} + +static void datetime_test(void) +{ + size_t index; + int64_t secs_expected; + int32_t nanosecs; + int32_t ofs; + + plan(355); + parse_datetime(sample, sizeof(sample) - 1, + &secs_expected, &nanosecs, &ofs); + + for (index = 0; index < DIM(tests); index++) { + int64_t secs; + int rc = parse_datetime(tests[index].sz, tests[index].len, + &secs, &nanosecs, &ofs); + is(rc, 0, "correct parse_datetime return value for '%s'", + tests[index].sz); + is(secs, secs_expected, "correct parse_datetime output " + "seconds for '%s", tests[index].sz); + + /* check that stringized literal produces the same date */ + /* time fields */ + static char buff[40]; + struct datetime dt = {secs, nanosecs, ofs}; + /* datetime_to_tm returns time in GMT zone */ + struct tm * p_tm = datetime_to_tm(&dt); + size_t len = strftime(buff, sizeof buff, "%F %T", p_tm); + ok(len > 0, "strftime"); + int64_t parsed_secs; + int32_t parsed_nsecs, parsed_ofs; + rc = parse_datetime(buff, len, &parsed_secs, &parsed_nsecs, &parsed_ofs); + is(rc, 0, "correct parse_datetime return value for '%s'", buff); + is(secs, parsed_secs, + "reversible seconds via strftime for '%s", buff); + } +} + +int +main(void) +{ + plan(1); + datetime_test(); + + return check_plan(); +} diff --git a/test/unit/datetime.result b/test/unit/datetime.result new file mode 100644 index 000000000..33997d9df --- /dev/null +++ b/test/unit/datetime.result @@ -0,0 +1,358 @@ +1..1 + 1..355 + ok 1 - correct parse_datetime return value for '2012-12-24 15:30Z' + ok 2 - correct parse_datetime output seconds for '2012-12-24 15:30Z + ok 3 - strftime + ok 4 - correct parse_datetime return value for '2012-12-24 15:30:00' + ok 5 - reversible seconds via strftime for '2012-12-24 15:30:00 + ok 6 - correct parse_datetime return value for '2012-12-24 15:30z' + ok 7 - correct parse_datetime output seconds for '2012-12-24 15:30z + ok 8 - strftime + ok 9 - correct parse_datetime return value for '2012-12-24 15:30:00' + ok 10 - reversible seconds via strftime for '2012-12-24 15:30:00 + ok 11 - correct parse_datetime return value for '2012-12-24 15:30' + ok 12 - correct parse_datetime output seconds for '2012-12-24 15:30 + ok 13 - strftime + ok 14 - correct parse_datetime return value for '2012-12-24 15:30:00' + ok 15 - reversible seconds via strftime for '2012-12-24 15:30:00 + ok 16 - correct parse_datetime return value for '2012-12-24 16:30+01:00' + ok 17 - correct parse_datetime output seconds for '2012-12-24 16:30+01:00 + ok 18 - strftime + ok 19 - correct parse_datetime return value for '2012-12-24 15:30:00' + ok 20 - reversible seconds via strftime for '2012-12-24 15:30:00 + ok 21 - correct parse_datetime return value for '2012-12-24 16:30+0100' + ok 22 - correct parse_datetime output seconds for '2012-12-24 16:30+0100 + ok 23 - strftime + ok 24 - correct parse_datetime return value for '2012-12-24 15:30:00' + ok 25 - reversible seconds via strftime for '2012-12-24 15:30:00 + ok 26 - correct parse_datetime return value for '2012-12-24 16:30+01' + ok 27 - correct parse_datetime output seconds for '2012-12-24 16:30+01 + ok 28 - strftime + ok 29 - correct parse_datetime return value for '2012-12-24 15:30:00' + ok 30 - reversible seconds via strftime for '2012-12-24 15:30:00 + ok 31 - correct parse_datetime return value for '2012-12-24 14:30-01:00' + ok 32 - correct parse_datetime output seconds for '2012-12-24 14:30-01:00 + ok 33 - strftime + ok 34 - correct parse_datetime return value for '2012-12-24 15:30:00' + ok 35 - reversible seconds via strftime for '2012-12-24 15:30:00 + ok 36 - correct parse_datetime return value for '2012-12-24 14:30-0100' + ok 37 - correct parse_datetime output seconds for '2012-12-24 14:30-0100 + ok 38 - strftime + ok 39 - correct parse_datetime return value for '2012-12-24 15:30:00' + ok 40 - reversible seconds via strftime for '2012-12-24 15:30:00 + ok 41 - correct parse_datetime return value for '2012-12-24 14:30-01' + ok 42 - correct parse_datetime output seconds for '2012-12-24 14:30-01 + ok 43 - strftime + ok 44 - correct parse_datetime return value for '2012-12-24 15:30:00' + ok 45 - reversible seconds via strftime for '2012-12-24 15:30:00 + ok 46 - correct parse_datetime return value for '2012-12-24 15:30:00Z' + ok 47 - correct parse_datetime output seconds for '2012-12-24 15:30:00Z + ok 48 - strftime + ok 49 - correct parse_datetime return value for '2012-12-24 15:30:00' + ok 50 - reversible seconds via strftime for '2012-12-24 15:30:00 + ok 51 - correct parse_datetime return value for '2012-12-24 15:30:00z' + ok 52 - correct parse_datetime output seconds for '2012-12-24 15:30:00z + ok 53 - strftime + ok 54 - correct parse_datetime return value for '2012-12-24 15:30:00' + ok 55 - reversible seconds via strftime for '2012-12-24 15:30:00 + ok 56 - correct parse_datetime return value for '2012-12-24 15:30:00' + ok 57 - correct parse_datetime output seconds for '2012-12-24 15:30:00 + ok 58 - strftime + ok 59 - correct parse_datetime return value for '2012-12-24 15:30:00' + ok 60 - reversible seconds via strftime for '2012-12-24 15:30:00 + ok 61 - correct parse_datetime return value for '2012-12-24 16:30:00+01:00' + ok 62 - correct parse_datetime output seconds for '2012-12-24 16:30:00+01:00 + ok 63 - strftime + ok 64 - correct parse_datetime return value for '2012-12-24 15:30:00' + ok 65 - reversible seconds via strftime for '2012-12-24 15:30:00 + ok 66 - correct parse_datetime return value for '2012-12-24 16:30:00+0100' + ok 67 - correct parse_datetime output seconds for '2012-12-24 16:30:00+0100 + ok 68 - strftime + ok 69 - correct parse_datetime return value for '2012-12-24 15:30:00' + ok 70 - reversible seconds via strftime for '2012-12-24 15:30:00 + ok 71 - correct parse_datetime return value for '2012-12-24 14:30:00-01:00' + ok 72 - correct parse_datetime output seconds for '2012-12-24 14:30:00-01:00 + ok 73 - strftime + ok 74 - correct parse_datetime return value for '2012-12-24 15:30:00' + ok 75 - reversible seconds via strftime for '2012-12-24 15:30:00 + ok 76 - correct parse_datetime return value for '2012-12-24 14:30:00-0100' + ok 77 - correct parse_datetime output seconds for '2012-12-24 14:30:00-0100 + ok 78 - strftime + ok 79 - correct parse_datetime return value for '2012-12-24 15:30:00' + ok 80 - reversible seconds via strftime for '2012-12-24 15:30:00 + ok 81 - correct parse_datetime return value for '2012-12-24 15:30:00.123456Z' + ok 82 - correct parse_datetime output seconds for '2012-12-24 15:30:00.123456Z + ok 83 - strftime + ok 84 - correct parse_datetime return value for '2012-12-24 15:30:00' + ok 85 - reversible seconds via strftime for '2012-12-24 15:30:00 + ok 86 - correct parse_datetime return value for '2012-12-24 15:30:00.123456z' + ok 87 - correct parse_datetime output seconds for '2012-12-24 15:30:00.123456z + ok 88 - strftime + ok 89 - correct parse_datetime return value for '2012-12-24 15:30:00' + ok 90 - reversible seconds via strftime for '2012-12-24 15:30:00 + ok 91 - correct parse_datetime return value for '2012-12-24 15:30:00.123456' + ok 92 - correct parse_datetime output seconds for '2012-12-24 15:30:00.123456 + ok 93 - strftime + ok 94 - correct parse_datetime return value for '2012-12-24 15:30:00' + ok 95 - reversible seconds via strftime for '2012-12-24 15:30:00 + ok 96 - correct parse_datetime return value for '2012-12-24 16:30:00.123456+01:00' + ok 97 - correct parse_datetime output seconds for '2012-12-24 16:30:00.123456+01:00 + ok 98 - strftime + ok 99 - correct parse_datetime return value for '2012-12-24 15:30:00' + ok 100 - reversible seconds via strftime for '2012-12-24 15:30:00 + ok 101 - correct parse_datetime return value for '2012-12-24 16:30:00.123456+01' + ok 102 - correct parse_datetime output seconds for '2012-12-24 16:30:00.123456+01 + ok 103 - strftime + ok 104 - correct parse_datetime return value for '2012-12-24 15:30:00' + ok 105 - reversible seconds via strftime for '2012-12-24 15:30:00 + ok 106 - correct parse_datetime return value for '2012-12-24 14:30:00.123456-01:00' + ok 107 - correct parse_datetime output seconds for '2012-12-24 14:30:00.123456-01:00 + ok 108 - strftime + ok 109 - correct parse_datetime return value for '2012-12-24 15:30:00' + ok 110 - reversible seconds via strftime for '2012-12-24 15:30:00 + ok 111 - correct parse_datetime return value for '2012-12-24 14:30:00.123456-01' + ok 112 - correct parse_datetime output seconds for '2012-12-24 14:30:00.123456-01 + ok 113 - strftime + ok 114 - correct parse_datetime return value for '2012-12-24 15:30:00' + ok 115 - reversible seconds via strftime for '2012-12-24 15:30:00 + ok 116 - correct parse_datetime return value for '2012-12-24t15:30Z' + ok 117 - correct parse_datetime output seconds for '2012-12-24t15:30Z + ok 118 - strftime + ok 119 - correct parse_datetime return value for '2012-12-24 15:30:00' + ok 120 - reversible seconds via strftime for '2012-12-24 15:30:00 + ok 121 - correct parse_datetime return value for '2012-12-24t15:30z' + ok 122 - correct parse_datetime output seconds for '2012-12-24t15:30z + ok 123 - strftime + ok 124 - correct parse_datetime return value for '2012-12-24 15:30:00' + ok 125 - reversible seconds via strftime for '2012-12-24 15:30:00 + ok 126 - correct parse_datetime return value for '2012-12-24t15:30' + ok 127 - correct parse_datetime output seconds for '2012-12-24t15:30 + ok 128 - strftime + ok 129 - correct parse_datetime return value for '2012-12-24 15:30:00' + ok 130 - reversible seconds via strftime for '2012-12-24 15:30:00 + ok 131 - correct parse_datetime return value for '2012-12-24t16:30+01:00' + ok 132 - correct parse_datetime output seconds for '2012-12-24t16:30+01:00 + ok 133 - strftime + ok 134 - correct parse_datetime return value for '2012-12-24 15:30:00' + ok 135 - reversible seconds via strftime for '2012-12-24 15:30:00 + ok 136 - correct parse_datetime return value for '2012-12-24t16:30+0100' + ok 137 - correct parse_datetime output seconds for '2012-12-24t16:30+0100 + ok 138 - strftime + ok 139 - correct parse_datetime return value for '2012-12-24 15:30:00' + ok 140 - reversible seconds via strftime for '2012-12-24 15:30:00 + ok 141 - correct parse_datetime return value for '2012-12-24t14:30-01:00' + ok 142 - correct parse_datetime output seconds for '2012-12-24t14:30-01:00 + ok 143 - strftime + ok 144 - correct parse_datetime return value for '2012-12-24 15:30:00' + ok 145 - reversible seconds via strftime for '2012-12-24 15:30:00 + ok 146 - correct parse_datetime return value for '2012-12-24t14:30-0100' + ok 147 - correct parse_datetime output seconds for '2012-12-24t14:30-0100 + ok 148 - strftime + ok 149 - correct parse_datetime return value for '2012-12-24 15:30:00' + ok 150 - reversible seconds via strftime for '2012-12-24 15:30:00 + ok 151 - correct parse_datetime return value for '2012-12-24t15:30:00Z' + ok 152 - correct parse_datetime output seconds for '2012-12-24t15:30:00Z + ok 153 - strftime + ok 154 - correct parse_datetime return value for '2012-12-24 15:30:00' + ok 155 - reversible seconds via strftime for '2012-12-24 15:30:00 + ok 156 - correct parse_datetime return value for '2012-12-24t15:30:00z' + ok 157 - correct parse_datetime output seconds for '2012-12-24t15:30:00z + ok 158 - strftime + ok 159 - correct parse_datetime return value for '2012-12-24 15:30:00' + ok 160 - reversible seconds via strftime for '2012-12-24 15:30:00 + ok 161 - correct parse_datetime return value for '2012-12-24t15:30:00' + ok 162 - correct parse_datetime output seconds for '2012-12-24t15:30:00 + ok 163 - strftime + ok 164 - correct parse_datetime return value for '2012-12-24 15:30:00' + ok 165 - reversible seconds via strftime for '2012-12-24 15:30:00 + ok 166 - correct parse_datetime return value for '2012-12-24t16:30:00+01:00' + ok 167 - correct parse_datetime output seconds for '2012-12-24t16:30:00+01:00 + ok 168 - strftime + ok 169 - correct parse_datetime return value for '2012-12-24 15:30:00' + ok 170 - reversible seconds via strftime for '2012-12-24 15:30:00 + ok 171 - correct parse_datetime return value for '2012-12-24t16:30:00+0100' + ok 172 - correct parse_datetime output seconds for '2012-12-24t16:30:00+0100 + ok 173 - strftime + ok 174 - correct parse_datetime return value for '2012-12-24 15:30:00' + ok 175 - reversible seconds via strftime for '2012-12-24 15:30:00 + ok 176 - correct parse_datetime return value for '2012-12-24t14:30:00-01:00' + ok 177 - correct parse_datetime output seconds for '2012-12-24t14:30:00-01:00 + ok 178 - strftime + ok 179 - correct parse_datetime return value for '2012-12-24 15:30:00' + ok 180 - reversible seconds via strftime for '2012-12-24 15:30:00 + ok 181 - correct parse_datetime return value for '2012-12-24t14:30:00-0100' + ok 182 - correct parse_datetime output seconds for '2012-12-24t14:30:00-0100 + ok 183 - strftime + ok 184 - correct parse_datetime return value for '2012-12-24 15:30:00' + ok 185 - reversible seconds via strftime for '2012-12-24 15:30:00 + ok 186 - correct parse_datetime return value for '2012-12-24t15:30:00.123456Z' + ok 187 - correct parse_datetime output seconds for '2012-12-24t15:30:00.123456Z + ok 188 - strftime + ok 189 - correct parse_datetime return value for '2012-12-24 15:30:00' + ok 190 - reversible seconds via strftime for '2012-12-24 15:30:00 + ok 191 - correct parse_datetime return value for '2012-12-24t15:30:00.123456z' + ok 192 - correct parse_datetime output seconds for '2012-12-24t15:30:00.123456z + ok 193 - strftime + ok 194 - correct parse_datetime return value for '2012-12-24 15:30:00' + ok 195 - reversible seconds via strftime for '2012-12-24 15:30:00 + ok 196 - correct parse_datetime return value for '2012-12-24t16:30:00.123456+01:00' + ok 197 - correct parse_datetime output seconds for '2012-12-24t16:30:00.123456+01:00 + ok 198 - strftime + ok 199 - correct parse_datetime return value for '2012-12-24 15:30:00' + ok 200 - reversible seconds via strftime for '2012-12-24 15:30:00 + ok 201 - correct parse_datetime return value for '2012-12-24t14:30:00.123456-01:00' + ok 202 - correct parse_datetime output seconds for '2012-12-24t14:30:00.123456-01:00 + ok 203 - strftime + ok 204 - correct parse_datetime return value for '2012-12-24 15:30:00' + ok 205 - reversible seconds via strftime for '2012-12-24 15:30:00 + ok 206 - correct parse_datetime return value for '2012-12-24 16:30 +01:00' + ok 207 - correct parse_datetime output seconds for '2012-12-24 16:30 +01:00 + ok 208 - strftime + ok 209 - correct parse_datetime return value for '2012-12-24 15:30:00' + ok 210 - reversible seconds via strftime for '2012-12-24 15:30:00 + ok 211 - correct parse_datetime return value for '2012-12-24 14:30 -01:00' + ok 212 - correct parse_datetime output seconds for '2012-12-24 14:30 -01:00 + ok 213 - strftime + ok 214 - correct parse_datetime return value for '2012-12-24 15:30:00' + ok 215 - reversible seconds via strftime for '2012-12-24 15:30:00 + ok 216 - correct parse_datetime return value for '2012-12-24 15:30 UTC' + ok 217 - correct parse_datetime output seconds for '2012-12-24 15:30 UTC + ok 218 - strftime + ok 219 - correct parse_datetime return value for '2012-12-24 15:30:00' + ok 220 - reversible seconds via strftime for '2012-12-24 15:30:00 + ok 221 - correct parse_datetime return value for '2012-12-24 16:30 UTC+1' + ok 222 - correct parse_datetime output seconds for '2012-12-24 16:30 UTC+1 + ok 223 - strftime + ok 224 - correct parse_datetime return value for '2012-12-24 15:30:00' + ok 225 - reversible seconds via strftime for '2012-12-24 15:30:00 + ok 226 - correct parse_datetime return value for '2012-12-24 16:30 UTC+01' + ok 227 - correct parse_datetime output seconds for '2012-12-24 16:30 UTC+01 + ok 228 - strftime + ok 229 - correct parse_datetime return value for '2012-12-24 15:30:00' + ok 230 - reversible seconds via strftime for '2012-12-24 15:30:00 + ok 231 - correct parse_datetime return value for '2012-12-24 16:30 UTC+0100' + ok 232 - correct parse_datetime output seconds for '2012-12-24 16:30 UTC+0100 + ok 233 - strftime + ok 234 - correct parse_datetime return value for '2012-12-24 15:30:00' + ok 235 - reversible seconds via strftime for '2012-12-24 15:30:00 + ok 236 - correct parse_datetime return value for '2012-12-24 16:30 UTC+01:00' + ok 237 - correct parse_datetime output seconds for '2012-12-24 16:30 UTC+01:00 + ok 238 - strftime + ok 239 - correct parse_datetime return value for '2012-12-24 15:30:00' + ok 240 - reversible seconds via strftime for '2012-12-24 15:30:00 + ok 241 - correct parse_datetime return value for '2012-12-24 14:30 UTC-1' + ok 242 - correct parse_datetime output seconds for '2012-12-24 14:30 UTC-1 + ok 243 - strftime + ok 244 - correct parse_datetime return value for '2012-12-24 15:30:00' + ok 245 - reversible seconds via strftime for '2012-12-24 15:30:00 + ok 246 - correct parse_datetime return value for '2012-12-24 14:30 UTC-01' + ok 247 - correct parse_datetime output seconds for '2012-12-24 14:30 UTC-01 + ok 248 - strftime + ok 249 - correct parse_datetime return value for '2012-12-24 15:30:00' + ok 250 - reversible seconds via strftime for '2012-12-24 15:30:00 + ok 251 - correct parse_datetime return value for '2012-12-24 14:30 UTC-01:00' + ok 252 - correct parse_datetime output seconds for '2012-12-24 14:30 UTC-01:00 + ok 253 - strftime + ok 254 - correct parse_datetime return value for '2012-12-24 15:30:00' + ok 255 - reversible seconds via strftime for '2012-12-24 15:30:00 + ok 256 - correct parse_datetime return value for '2012-12-24 14:30 UTC-0100' + ok 257 - correct parse_datetime output seconds for '2012-12-24 14:30 UTC-0100 + ok 258 - strftime + ok 259 - correct parse_datetime return value for '2012-12-24 15:30:00' + ok 260 - reversible seconds via strftime for '2012-12-24 15:30:00 + ok 261 - correct parse_datetime return value for '2012-12-24 15:30 GMT' + ok 262 - correct parse_datetime output seconds for '2012-12-24 15:30 GMT + ok 263 - strftime + ok 264 - correct parse_datetime return value for '2012-12-24 15:30:00' + ok 265 - reversible seconds via strftime for '2012-12-24 15:30:00 + ok 266 - correct parse_datetime return value for '2012-12-24 16:30 GMT+1' + ok 267 - correct parse_datetime output seconds for '2012-12-24 16:30 GMT+1 + ok 268 - strftime + ok 269 - correct parse_datetime return value for '2012-12-24 15:30:00' + ok 270 - reversible seconds via strftime for '2012-12-24 15:30:00 + ok 271 - correct parse_datetime return value for '2012-12-24 16:30 GMT+01' + ok 272 - correct parse_datetime output seconds for '2012-12-24 16:30 GMT+01 + ok 273 - strftime + ok 274 - correct parse_datetime return value for '2012-12-24 15:30:00' + ok 275 - reversible seconds via strftime for '2012-12-24 15:30:00 + ok 276 - correct parse_datetime return value for '2012-12-24 16:30 GMT+0100' + ok 277 - correct parse_datetime output seconds for '2012-12-24 16:30 GMT+0100 + ok 278 - strftime + ok 279 - correct parse_datetime return value for '2012-12-24 15:30:00' + ok 280 - reversible seconds via strftime for '2012-12-24 15:30:00 + ok 281 - correct parse_datetime return value for '2012-12-24 16:30 GMT+01:00' + ok 282 - correct parse_datetime output seconds for '2012-12-24 16:30 GMT+01:00 + ok 283 - strftime + ok 284 - correct parse_datetime return value for '2012-12-24 15:30:00' + ok 285 - reversible seconds via strftime for '2012-12-24 15:30:00 + ok 286 - correct parse_datetime return value for '2012-12-24 14:30 GMT-1' + ok 287 - correct parse_datetime output seconds for '2012-12-24 14:30 GMT-1 + ok 288 - strftime + ok 289 - correct parse_datetime return value for '2012-12-24 15:30:00' + ok 290 - reversible seconds via strftime for '2012-12-24 15:30:00 + ok 291 - correct parse_datetime return value for '2012-12-24 14:30 GMT-01' + ok 292 - correct parse_datetime output seconds for '2012-12-24 14:30 GMT-01 + ok 293 - strftime + ok 294 - correct parse_datetime return value for '2012-12-24 15:30:00' + ok 295 - reversible seconds via strftime for '2012-12-24 15:30:00 + ok 296 - correct parse_datetime return value for '2012-12-24 14:30 GMT-01:00' + ok 297 - correct parse_datetime output seconds for '2012-12-24 14:30 GMT-01:00 + ok 298 - strftime + ok 299 - correct parse_datetime return value for '2012-12-24 15:30:00' + ok 300 - reversible seconds via strftime for '2012-12-24 15:30:00 + ok 301 - correct parse_datetime return value for '2012-12-24 14:30 GMT-0100' + ok 302 - correct parse_datetime output seconds for '2012-12-24 14:30 GMT-0100 + ok 303 - strftime + ok 304 - correct parse_datetime return value for '2012-12-24 15:30:00' + ok 305 - reversible seconds via strftime for '2012-12-24 15:30:00 + ok 306 - correct parse_datetime return value for '2012-12-24 14:30 -01:00' + ok 307 - correct parse_datetime output seconds for '2012-12-24 14:30 -01:00 + ok 308 - strftime + ok 309 - correct parse_datetime return value for '2012-12-24 15:30:00' + ok 310 - reversible seconds via strftime for '2012-12-24 15:30:00 + ok 311 - correct parse_datetime return value for '2012-12-24 16:30:00 +01:00' + ok 312 - correct parse_datetime output seconds for '2012-12-24 16:30:00 +01:00 + ok 313 - strftime + ok 314 - correct parse_datetime return value for '2012-12-24 15:30:00' + ok 315 - reversible seconds via strftime for '2012-12-24 15:30:00 + ok 316 - correct parse_datetime return value for '2012-12-24 14:30:00 -01:00' + ok 317 - correct parse_datetime output seconds for '2012-12-24 14:30:00 -01:00 + ok 318 - strftime + ok 319 - correct parse_datetime return value for '2012-12-24 15:30:00' + ok 320 - reversible seconds via strftime for '2012-12-24 15:30:00 + ok 321 - correct parse_datetime return value for '2012-12-24 16:30:00.123456 +01:00' + ok 322 - correct parse_datetime output seconds for '2012-12-24 16:30:00.123456 +01:00 + ok 323 - strftime + ok 324 - correct parse_datetime return value for '2012-12-24 15:30:00' + ok 325 - reversible seconds via strftime for '2012-12-24 15:30:00 + ok 326 - correct parse_datetime return value for '2012-12-24 14:30:00.123456 -01:00' + ok 327 - correct parse_datetime output seconds for '2012-12-24 14:30:00.123456 -01:00 + ok 328 - strftime + ok 329 - correct parse_datetime return value for '2012-12-24 15:30:00' + ok 330 - reversible seconds via strftime for '2012-12-24 15:30:00 + ok 331 - correct parse_datetime return value for '2012-12-24 15:30:00.123456 -00:00' + ok 332 - correct parse_datetime output seconds for '2012-12-24 15:30:00.123456 -00:00 + ok 333 - strftime + ok 334 - correct parse_datetime return value for '2012-12-24 15:30:00' + ok 335 - reversible seconds via strftime for '2012-12-24 15:30:00 + ok 336 - correct parse_datetime return value for '20121224T1630+01:00' + ok 337 - correct parse_datetime output seconds for '20121224T1630+01:00 + ok 338 - strftime + ok 339 - correct parse_datetime return value for '2012-12-24 15:30:00' + ok 340 - reversible seconds via strftime for '2012-12-24 15:30:00 + ok 341 - correct parse_datetime return value for '2012-12-24T1630+01:00' + ok 342 - correct parse_datetime output seconds for '2012-12-24T1630+01:00 + ok 343 - strftime + ok 344 - correct parse_datetime return value for '2012-12-24 15:30:00' + ok 345 - reversible seconds via strftime for '2012-12-24 15:30:00 + ok 346 - correct parse_datetime return value for '20121224T16:30+01' + ok 347 - correct parse_datetime output seconds for '20121224T16:30+01 + ok 348 - strftime + ok 349 - correct parse_datetime return value for '2012-12-24 15:30:00' + ok 350 - reversible seconds via strftime for '2012-12-24 15:30:00 + ok 351 - correct parse_datetime return value for '20121224T16:30 +01' + ok 352 - correct parse_datetime output seconds for '20121224T16:30 +01 + ok 353 - strftime + ok 354 - correct parse_datetime return value for '2012-12-24 15:30:00' + ok 355 - reversible seconds via strftime for '2012-12-24 15:30:00 +ok 1 - subtests diff --git a/third_party/c-dt b/third_party/c-dt new file mode 160000 index 000000000..5b1398ca8 --- /dev/null +++ b/third_party/c-dt @@ -0,0 +1 @@ +Subproject commit 5b1398ca8f53513985670a2e832b5f6e253addf7 -- 2.29.2