Back to index

glibc  2.9
Defines | Functions
tst-mktime3.c File Reference
#include <stdlib.h>
#include <stdio.h>
#include <time.h>

Go to the source code of this file.

Defines

#define CHECK(name)

Functions

int main (void)

Define Documentation

#define CHECK (   name)
Value:
if (tests[i].name != expected[i].name)                  \
       {                                                \
         printf ("test %d " #name " got %d expected %d\n",     \
                i, tests[i].name, expected[i].name);           \
         return 1;                                      \
       }

Function Documentation

int main ( void  )

Definition at line 21 of file tst-mktime3.c.

{
  setenv ("TZ", "UTC", 1);
  int i;
  for (i = 0; i < sizeof (tests) / sizeof (tests[0]); ++i)
    {
      if (mktime (&tests[i]) < 0)
       {
         printf ("mktime %d failed\n", i);
         return 1;
       }
#define CHECK(name) \
      if (tests[i].name != expected[i].name)                   \
       {                                                \
         printf ("test %d " #name " got %d expected %d\n",     \
                i, tests[i].name, expected[i].name);           \
         return 1;                                      \
       }
      CHECK (tm_sec)
      CHECK (tm_min)
      CHECK (tm_hour)
      CHECK (tm_mday)
      CHECK (tm_mon)
      CHECK (tm_year)
      CHECK (tm_wday)
      CHECK (tm_yday)
      CHECK (tm_isdst)
    }
  return 0;
}

Here is the call graph for this function: