libc/minimal: fix reproducibility of gmtime

struct tm has fields that were not being set by the implementation,
causing the test to fail when the uninitialized values were compared
with a static initialized result.  Zero the structure before filling it.

Closes #17794

Signed-off-by: Peter A. Bigot <pab@pabigot.com>
This commit is contained in:
Peter A. Bigot 2019-07-30 13:39:20 -05:00 committed by Ioannis Glaropoulos
commit b8af1a6a4e
2 changed files with 6 additions and 1 deletions

View file

@ -12,7 +12,10 @@
void test_gmtime(void)
{
struct tm tm;
struct tm tm = {
/* Initialize an unset field */
.tm_isdst = 1234,
};
time_t time = 1561994005;
zassert_equal(&tm, gmtime_r(&time, &tm),