<html lang='en'>
<head>
<meta content='text/html; charset=utf-8' http-equiv='Content-Type'>
<title>
GitLab
</title>
</meta>
</head>
<style>
  img {
    max-width: 100%;
    height: auto;
  }
  p.details {
    font-style:italic;
    color:#777
  }
  .footer p {
    font-size:small;
    color:#777
  }
  pre.commit-message {
    white-space: pre-wrap;
  }
  .file-stats a {
    text-decoration: none;
  }
  .file-stats .new-file {
    color: #090;
  }
  .file-stats .deleted-file {
    color: #B00;
  }
</style>
<body>
<div class='content'>
<h3>Amar Takhar pushed to branch master at <a href="https://gitlab.com/NTPsec/ntpsec">NTPsec / ntpsec</a></h3>
<h4>
Commits:
</h4>
<ul>
<li>
<strong><a href="https://gitlab.com/NTPsec/ntpsec/commit/a26e3a0a7f93ebcd5878049162d8533a53a3cc08">a26e3a0a</a></strong>
<div>
<span>by Amar Takhar</span>
<i>at 2015-12-04T13:55:04Z</i>
</div>
<pre class='commit-message'>Convert libntp/humandate.c</pre>
</li>
<li>
<strong><a href="https://gitlab.com/NTPsec/ntpsec/commit/d013bd510cea7a5fbf6646e08e73e3daf51c17c9">d013bd51</a></strong>
<div>
<span>by Amar Takhar</span>
<i>at 2015-12-04T14:02:38Z</i>
</div>
<pre class='commit-message'>For loop initial declarations are in C99.</pre>
</li>
</ul>
<h4>4 changed files:</h4>
<ul>
<li class='file-stats'>
<a href='#diff-0'>
tests/common/tests_main.c
</a>
</li>
<li class='file-stats'>
<a href='#diff-1'>
tests/libntp/calendar.c
</a>
</li>
<li class='file-stats'>
<a href='#diff-2'>
tests/libntp/humandate.c
</a>
</li>
<li class='file-stats'>
<a href='#diff-3'>
tests/wscript
</a>
</li>
</ul>
<h4>Changes:</h4>
<li id='diff-0'>
<a href='https://gitlab.com/NTPsec/ntpsec/compare/c0ef5549f227759a99ebae150e7f0e97a263301c...d013bd510cea7a5fbf6646e08e73e3daf51c17c9#diff-0'>
<strong>
tests/common/tests_main.c
</strong>
</a>
<hr>
<pre class="highlight"><code><span style="color: #000000;background-color: #ffdddd">--- a/tests/common/tests_main.c
</span><span style="color: #000000;background-color: #ddffdd">+++ b/tests/common/tests_main.c
</span><span style="color: #aaaaaa">@@ -48,7 +48,7 @@ static void RunAllTests(void)
</span>   RUN_TEST_GROUP(clocktime);
        RUN_TEST_GROUP(decodenetnum);
        RUN_TEST_GROUP(hextolfp);
<span style="color: #000000;background-color: #ffdddd">-//      RUN_TEST_GROUP(humandate);
</span><span style="color: #000000;background-color: #ddffdd">+   RUN_TEST_GROUP(humandate);
</span> //        RUN_TEST_GROUP(lfp);
 //     RUN_TEST_GROUP(lfptostr);
        RUN_TEST_GROUP(modetoa);
</code></pre>

<br>
</li>
<li id='diff-1'>
<a href='https://gitlab.com/NTPsec/ntpsec/compare/c0ef5549f227759a99ebae150e7f0e97a263301c...d013bd510cea7a5fbf6646e08e73e3daf51c17c9#diff-1'>
<strong>
tests/libntp/calendar.c
</strong>
</a>
<hr>
<pre class="highlight"><code><span style="color: #000000;background-color: #ffdddd">--- a/tests/libntp/calendar.c
</span><span style="color: #000000;background-color: #ddffdd">+++ b/tests/libntp/calendar.c
</span><span style="color: #aaaaaa">@@ -120,8 +120,11 @@ static const u_short real_month_days[2][14] = {
</span> // intermediate results would definitely overflow and the hi DWORD of
 // the 'vint64' is definitely needed.
 TEST(calendar, DaySplitMerge) {
<span style="color: #000000;background-color: #ffdddd">-        for (int32_t day = -1000000; day <= 1000000; day += 100) {
-               for (int32_t sec = -100000; sec <= 186400; sec += 10000) {
</span><span style="color: #000000;background-color: #ddffdd">+   int32_t day;
+       int32_t sec;
+
+       for (day = -1000000; day <= 1000000; day += 100) {
+               for (sec = -100000; sec <= 186400; sec += 10000) {
</span>                   vint64       merge = ntpcal_dayjoin(day, sec);
                        ntpcal_split split = ntpcal_daysplit(&merge);
                        int32_t      eday  = day;
<span style="color: #aaaaaa">@@ -143,7 +146,9 @@ TEST(calendar, DaySplitMerge) {
</span> }
 
 TEST(calendar, SplitYearDays1) {
<span style="color: #000000;background-color: #ffdddd">-        for (int32_t eyd = -1; eyd <= 365; eyd++) {
</span><span style="color: #000000;background-color: #ddffdd">+   int32_t eyd;
+
+       for (eyd = -1; eyd <= 365; eyd++) {
</span>           ntpcal_split split = ntpcal_split_yeardays(eyd, 0);
                if (split.lo >= 0 && split.hi >= 0) {
                        TEST_ASSERT_GREATER_THAN(12, split.hi);
<span style="color: #aaaaaa">@@ -156,7 +161,9 @@ TEST(calendar, SplitYearDays1) {
</span> }
 
 TEST(calendar, SplitYearDays2) {
<span style="color: #000000;background-color: #ffdddd">-        for (int32_t eyd = -1; eyd <= 366; eyd++) {
</span><span style="color: #000000;background-color: #ddffdd">+   int32_t eyd;
+
+       for (eyd = -1; eyd <= 366; eyd++) {
</span>           ntpcal_split split = ntpcal_split_yeardays(eyd, 1);
                if (split.lo >= 0 && split.hi >= 0) {
                        TEST_ASSERT_GREATER_THAN(12, split.hi);
</code></pre>

<br>
</li>
<li id='diff-2'>
<a href='https://gitlab.com/NTPsec/ntpsec/compare/c0ef5549f227759a99ebae150e7f0e97a263301c...d013bd510cea7a5fbf6646e08e73e3daf51c17c9#diff-2'>
<strong>
tests/libntp/humandate.c
</strong>
</a>
<hr>
<pre class="highlight"><code><span style="color: #000000;background-color: #ffdddd">--- a/tests/libntp/humandate.c
</span><span style="color: #000000;background-color: #ddffdd">+++ b/tests/libntp/humandate.c
</span><span style="color: #aaaaaa">@@ -1,10 +1,9 @@
</span> #include "config.h"
 #include "ntp_stdlib.h"
 
<span style="color: #000000;background-color: #ffdddd">-extern "C" {
</span> #include "unity.h"
 #include "unity_fixture.h"
<span style="color: #000000;background-color: #ffdddd">-}
</span><span style="color: #000000;background-color: #ddffdd">+
</span> 
 TEST_GROUP(humandate);
 
<span style="color: #aaaaaa">@@ -13,46 +12,36 @@ TEST_SETUP(humandate) {}
</span> TEST_TEAR_DOWN(humandate) {}
 
 
<span style="color: #000000;background-color: #ffdddd">-#include <sstream>
-#include <string>
-
-class humandateTest : public libntptest {
-};
-
</span> TEST(humandate, RegularTime) {
        time_t sample = 1276601278;
<span style="color: #000000;background-color: #ffdddd">-        std::ostringstream expected;
-       struct tm;
</span><span style="color: #000000;background-color: #ddffdd">+   char expected[255];
+
+       struct tm tmbuf;
</span> 
<span style="color: #000000;background-color: #ffdddd">-        tm* time;
</span><span style="color: #000000;background-color: #ddffdd">+   struct tm* time;
</span>   time = localtime_r(&sample, &tmbuf);
        TEST_ASSERT_TRUE(time != NULL);
 
<span style="color: #000000;background-color: #ffdddd">-        expected << std::setfill('0')
-                        << std::setw(2) << time->tm_hour << ":"
-                        << std::setw(2) << time->tm_min << ":"
-                        << std::setw(2) << time->tm_sec;
</span><span style="color: #000000;background-color: #ddffdd">+   snprintf(expected, 255, "%02d:%02d:%02d", time->tm_hour, time->tm_min, time->tm_sec);
</span> 
<span style="color: #000000;background-color: #ffdddd">-        TEST_ASSERT_EQUAL_STRING(expected.str().c_str(), humantime(sample));
</span><span style="color: #000000;background-color: #ddffdd">+   TEST_ASSERT_EQUAL_STRING(expected, humantime(sample));
</span> }
 
 TEST(humandate, CurrentTime) {
        time_t sample;
<span style="color: #000000;background-color: #ffdddd">-        std::ostringstream expected;
-       struct tm;
</span><span style="color: #000000;background-color: #ddffdd">+   char expected[255];
+
+       struct tm tmbuf;
</span> 
        time(&sample);
 
<span style="color: #000000;background-color: #ffdddd">-        tm* time;
</span><span style="color: #000000;background-color: #ddffdd">+   struct tm* time;
</span>   time = localtime_r(&sample, &tmbuf);
        TEST_ASSERT_TRUE(time != NULL);
 
<span style="color: #000000;background-color: #ffdddd">-        expected << std::setfill('0')
-                        << std::setw(2) << time->tm_hour << ":"
-                        << std::setw(2) << time->tm_min << ":"
-                        << std::setw(2) << time->tm_sec;
</span><span style="color: #000000;background-color: #ddffdd">+   snprintf(expected, 255, "%02d:%02d:%02d", time->tm_hour, time->tm_min, time->tm_sec);
</span> 
<span style="color: #000000;background-color: #ffdddd">-        TEST_ASSERT_EQUAL_STRING(expected.str().c_str(), humantime(sample));
</span><span style="color: #000000;background-color: #ddffdd">+   TEST_ASSERT_EQUAL_STRING(expected, humantime(sample));
</span> }
 
 TEST_GROUP_RUNNER(humandate) {
</code></pre>

<br>
</li>
<li id='diff-3'>
<a href='https://gitlab.com/NTPsec/ntpsec/compare/c0ef5549f227759a99ebae150e7f0e97a263301c...d013bd510cea7a5fbf6646e08e73e3daf51c17c9#diff-3'>
<strong>
tests/wscript
</strong>
</a>
<hr>
<pre class="highlight"><code><span style="color: #000000;background-color: #ffdddd">--- a/tests/wscript
</span><span style="color: #000000;background-color: #ddffdd">+++ b/tests/wscript
</span><span style="color: #aaaaaa">@@ -63,7 +63,7 @@ def build(ctx):
</span>           "libntp/clocktime.c",
                "libntp/decodenetnum.c",
                "libntp/hextolfp.c",
<span style="color: #000000;background-color: #ffdddd">-#               "libntp/humandate.c",
</span><span style="color: #000000;background-color: #ddffdd">+           "libntp/humandate.c",
</span> #         "libntp/lfpfunc.c",
 #              "libntp/lfptostr.c",
                "libntp/modetoa.c",
</code></pre>

<br>
</li>

</div>
<div class='footer' style='margin-top: 10px;'>
<p>

<br>
<a href="https://gitlab.com/NTPsec/ntpsec/compare/c0ef5549f227759a99ebae150e7f0e97a263301c...d013bd510cea7a5fbf6646e08e73e3daf51c17c9">View it on GitLab</a>.
<br>
You're receiving this email because of your account on gitlab.com.
If you'd like to receive fewer emails, you can adjust your notification settings.

</p>
</div>
</body>
</html>