<p>Josh Soref has uploaded this change for <strong>review</strong>.</p><p><a href="https://gerrit.asterisk.org/c/asterisk/+/17325">View Change</a></p><pre style="font-family: monospace,monospace; white-space: pre-wrap;">test_time.c: Tolerate DST transitions<br><br>When test_timezone_watch runs very near a DST transition,<br>two time zones that would otherwise be expected to report the same<br>time can differ because of the DST transition.<br><br>Instead of having the test fail when this happens, report the<br>times, time zones, and dst flags.<br><br>ASTERISK-29722<br><br>Change-Id: Id59bdac8b277e14343ccdf0c99b89e92f79f316a<br>---<br>M tests/test_time.c<br>1 file changed, 6 insertions(+), 2 deletions(-)<br><br></pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;">git pull ssh://gerrit.asterisk.org:29418/asterisk refs/changes/25/17325/1</pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;"><span>diff --git a/tests/test_time.c b/tests/test_time.c</span><br><span>index ceb2ae2..7c03381 100644</span><br><span>--- a/tests/test_time.c</span><br><span>+++ b/tests/test_time.c</span><br><span>@@ -91,8 +91,12 @@</span><br><span> ast_localtime(&tv, &atm[i], tzfile);</span><br><span> if (i != 0) {</span><br><span> if (atm[i].tm_hour == atm[i - 1].tm_hour) {</span><br><span style="color: hsl(0, 100%, 40%);">- res = AST_TEST_FAIL;</span><br><span style="color: hsl(0, 100%, 40%);">- 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]);</span><br><span style="color: hsl(120, 100%, 40%);">+ if (atm[i].tm_isdst == atm[i - 1].tm_isdst) {</span><br><span style="color: hsl(120, 100%, 40%);">+ res = AST_TEST_FAIL;</span><br><span style="color: hsl(120, 100%, 40%);">+ 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]);</span><br><span style="color: hsl(120, 100%, 40%);">+ } else {</span><br><span style="color: hsl(120, 100%, 40%);">+ 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);</span><br><span style="color: hsl(120, 100%, 40%);">+ }</span><br><span> }</span><br><span> }</span><br><span> </span><br><span></span><br></pre><p>To view, visit <a href="https://gerrit.asterisk.org/c/asterisk/+/17325">change 17325</a>. To unsubscribe, or for help writing mail filters, visit <a href="https://gerrit.asterisk.org/settings">settings</a>.</p><div itemscope itemtype="http://schema.org/EmailMessage"><div itemscope itemprop="action" itemtype="http://schema.org/ViewAction"><link itemprop="url" href="https://gerrit.asterisk.org/c/asterisk/+/17325"/><meta itemprop="name" content="View Change"/></div></div>
<div style="display:none"> Gerrit-Project: asterisk </div>
<div style="display:none"> Gerrit-Branch: master </div>
<div style="display:none"> Gerrit-Change-Id: Id59bdac8b277e14343ccdf0c99b89e92f79f316a </div>
<div style="display:none"> Gerrit-Change-Number: 17325 </div>
<div style="display:none"> Gerrit-PatchSet: 1 </div>
<div style="display:none"> Gerrit-Owner: Josh Soref <jsoref@gmail.com> </div>
<div style="display:none"> Gerrit-MessageType: newchange </div>