From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from deimos.uberspace.de (deimos.uberspace.de [185.26.156.152]) by sourceware.org (Postfix) with ESMTPS id F0A133858D1E for ; Mon, 11 Apr 2022 11:17:18 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org F0A133858D1E Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=jdoubleu.de Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=jdoubleu.de Received: (qmail 10973 invoked by uid 989); 11 Apr 2022 11:17:17 -0000 Authentication-Results: deimos.uberspace.de; auth=pass (plain) Content-Type: multipart/mixed; boundary="------------11ezBxeTx5qbxyGx6rc5XCWa" Message-ID: <836b0ac6-5e3a-03ca-d696-16adda6554a8@jdoubleu.de> Date: Mon, 11 Apr 2022 13:17:16 +0200 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:91.0) Gecko/20100101 Thunderbird/91.8.0 Subject: Re: [PATCH] add tests for tzset(3) Content-Language: en-US To: Dimitar Dimitrov Cc: newlib@sourceware.org References: <569f6ec3-6bc8-8170-c1fb-ed946020e258@jdoubleu.de> From: jdoubleu In-Reply-To: X-Rspamd-Bar: - X-Rspamd-Report: MIME_BASE64_TEXT_BOGUS(1) MIME_BASE64_TEXT(0.1) BAYES_HAM(-2.999948) MIME_GOOD(-0.1) X-Rspamd-Score: -1.999948 Received: from unknown (HELO unkown) (::1) by deimos.uberspace.de (Haraka/2.8.28) with ESMTPSA; Mon, 11 Apr 2022 13:17:16 +0200 X-Spam-Status: No, score=-10.1 required=5.0 tests=BAYES_00, BODY_8BITS, GIT_PATCH_0, KAM_DMARC_STATUS, MSGID_FROM_MTA_HEADER, NICE_REPLY_A, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, TXREP, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.4 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on server2.sourceware.org X-BeenThere: newlib@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Newlib mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 11 Apr 2022 11:17:21 -0000 This is a multi-part message in MIME format. --------------11ezBxeTx5qbxyGx6rc5XCWa Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit Hi, looks like I'm running the testsuite against glibc and not newlib (for target x86_64-pc-linux-gnu). I'm not even sure whether there's a backend for linux. I'm currently trying to run only the tzset code against the test vectors (like Brian Inglis did[1]). At least it show, that the newlib implementation differs from glibc. Maybe the test case is flawed and it should indeed fail. > 6:20:12 is the timezone string of the previous test case, whose tzset > call was successful. Looking at the current code, this is expected > behaviour. Okay. Looks like the condition[2] fails. The question is, which part of it does? I've appended a patch, which prints all variables when the condition fails. Could you please apply the patch and then recompile and re-run the tests again? I've previously noticed something with the sscanf format[3]. > Perhaps TZ should be reset to UTC before the bail out? I don't think the implementation should fall back to UTC whenever parsing failed. It apparently doesn't in glibc. I'm not sure if the behavior is specified somewhere. Maybe resetting it before each test case is a good idea, though. That makes it clearer, why the test case failed. > With that chunk removed, as shown below: > {"3:33:33", IN_SECONDS(3, 33, 33), NO_TIME}, // truncates the name (17 + 1) > I still get: > Assertion failed! Expected 1647906533 to equal 1647916532. winter time, timezone = "3:33:33" My bad; "3:33:33" isn't a valid timezone string. It has to be prefixed by a name e.g. "MESZ" or "<+00>", as you tried. That explains why it is also failing. Thanks for your effort so far! [1]: https://sourceware.org/pipermail/newlib/2022/019529.html [2]: https://sourceware.org/git/?p=newlib-cygwin.git;a=blob;f=newlib/libc/time/tzset_r.c;h=9cb30b188f989f65ec9eb6417f5d74020f8c72e9;hb=HEAD#l57 [3]: https://sourceware.org/pipermail/newlib/2022/019535.html Cheers --- 🙎🏻‍♂️ jdoubleu --------------11ezBxeTx5qbxyGx6rc5XCWa Content-Type: text/plain; charset=UTF-8; name="0001-debug-print-condition-values-of-tz-string-name-parsi.patch" Content-Disposition: attachment; filename*0="0001-debug-print-condition-values-of-tz-string-name-parsi.pa"; filename*1="tch" Content-Transfer-Encoding: base64 RnJvbSA4YzY5OGRjNjNmNzY1ZDRhNWIzYTQ5YTI1ODUwYzE3MzgyNzlkNjhkIE1vbiBTZXAg MTcgMDA6MDA6MDAgMjAwMQpGcm9tOiBqZG91YmxldSA8aGlAamRvdWJsZXUuZGU+CkRhdGU6 IE1vbiwgMTEgQXByIDIwMjIgMTM6MTA6MzggKzAyMDAKU3ViamVjdDogW1BBVENIXSBkZWJ1 ZyBwcmludCBjb25kaXRpb24gdmFsdWVzIG9mIHR6IHN0cmluZyBuYW1lIHBhcnNpbmcKCi0t LQogbmV3bGliL2xpYmMvdGltZS90enNldF9yLmMgfCA2ICsrKystLQogMSBmaWxlIGNoYW5n ZWQsIDQgaW5zZXJ0aW9ucygrKSwgMiBkZWxldGlvbnMoLSkKCmRpZmYgLS1naXQgYS9uZXds aWIvbGliYy90aW1lL3R6c2V0X3IuYyBiL25ld2xpYi9saWJjL3RpbWUvdHpzZXRfci5jCmlu ZGV4IDljYjMwYjE4OC4uZTIwYTMyYTYyIDEwMDY0NAotLS0gYS9uZXdsaWIvbGliYy90aW1l L3R6c2V0X3IuYworKysgYi9uZXdsaWIvbGliYy90aW1lL3R6c2V0X3IuYwpAQCAtNTQsOSAr NTQsMTEgQEAgX3R6c2V0X3VubG9ja2VkX3IgKHN0cnVjdCBfcmVlbnQgKnJlZW50X3B0cikK ICAgICAgICsrdHplbnY7CiAKICAgICAgIC8qIHF1aXQgaWYgbm8gaXRlbXMsIHRvbyBmZXcg b3IgdG9vIG1hbnkgY2hhcnMsIG9yIG5vIGNsb3NlIHF1b3RlICc+JyAqLwotICAgICAgaWYg KHNzY2FuZiAodHplbnYsICIlMTBbLSswLTlBLVphLXpdJW4iLCBfX3R6bmFtZV9zdGQsICZu KSA8PSAwCi0JCXx8IG4gPCBUWk5BTUVfTUlOIHx8IFRaTkFNRV9NQVggPCBuIHx8ICc+JyAh PSB0emVudltuXSkKKyAgICAgIGludCByZXMgPSBzc2NhbmYgKHR6ZW52LCAiJTEwWy0rMC05 QS1aYS16XSVuIiwgX190em5hbWVfc3RkLCAmbik7CisgICAgICBpZiAocmVzIDw9IDAgfHwg biA8IFRaTkFNRV9NSU4gfHwgVFpOQU1FX01BWCA8IG4gfHwgJz4nICE9IHR6ZW52W25dKSB7 CisgICAgICAgIHByaW50ZigicGFyc2luZyBuYW1lOiB0emVudj1cIiVzXCIsIHJlcz0lZCwg bj0lZCwgdHplbnZbbl0gPSAlY1xuIiwgdHplbnYsIHJlcywgbiwgdHplbnZbbl0pOwogICAg ICAgICByZXR1cm47CisgICAgICB9CiAKICAgICAgICsrdHplbnY7CS8qIGJ1bXAgZm9yIGNs b3NlIHF1b3RlICc+JyAqLwogICAgIH0KLS0gCjIuMzUuMQoK --------------11ezBxeTx5qbxyGx6rc5XCWa--