[Asterisk-code-review] Tolerate DST transitions (asterisk[master])

Josh Soref asteriskteam at digium.com
Sun Nov 7 09:33:08 CST 2021


Josh Soref has uploaded this change for review. ( https://gerrit.asterisk.org/c/asterisk/+/17300 )


Change subject: Tolerate DST transitions
......................................................................

Tolerate DST transitions

Change-Id: I7de86cccafd0d9805c5cf5ba8723dce267246552
---
M tests/test_time.c
1 file changed, 6 insertions(+), 2 deletions(-)



  git pull ssh://gerrit.asterisk.org:29418/asterisk refs/changes/00/17300/1

diff --git a/tests/test_time.c b/tests/test_time.c
index ceb2ae2..7c03381 100644
--- a/tests/test_time.c
+++ b/tests/test_time.c
@@ -91,8 +91,12 @@
 			ast_localtime(&tv, &atm[i], tzfile);
 			if (i != 0) {
 				if (atm[i].tm_hour == atm[i - 1].tm_hour) {
-					res = AST_TEST_FAIL;
-					ast_test_status_update(test, "Failed %s test: %d(%s) = %d(%s)\n", type == 0 ? "deletion" : "symlink", atm[i].tm_hour, zones[i], atm[i-1].tm_hour, zones[i-1]);
+					if (atm[i].tm_isdst == atm[i - 1].tm_isdst) {
+						res = AST_TEST_FAIL;
+						ast_test_status_update(test, "Failed %s test: %d(%s) = %d(%s)\n", type == 0 ? "deletion" : "symlink", atm[i].tm_hour, zones[i], atm[i-1].tm_hour, zones[i-1]);
+					} else {
+						ast_log(LOG_WARNING, "DST transition during %s test: %d(%s/%d) != %d(%s/%d)\n", type == 0 ? "deletion" : "symlink", atm[i].tm_hour, zones[i], atm[i].tm_isdst, atm[i-1].tm_hour, zones[i-1], atm[i-1].tm_isdst);
+					}
 				}
 			}
 

-- 
To view, visit https://gerrit.asterisk.org/c/asterisk/+/17300
To unsubscribe, or for help writing mail filters, visit https://gerrit.asterisk.org/settings

Gerrit-Project: asterisk
Gerrit-Branch: master
Gerrit-Change-Id: I7de86cccafd0d9805c5cf5ba8723dce267246552
Gerrit-Change-Number: 17300
Gerrit-PatchSet: 1
Gerrit-Owner: Josh Soref <jsoref at gmail.com>
Gerrit-MessageType: newchange
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.digium.com/pipermail/asterisk-code-review/attachments/20211107/ed41f592/attachment.html>


More information about the asterisk-code-review mailing list