Add parameter localtime in today() and now()
[libacl.git] / test / date_check_today.cpp
1 /*******************************************************
2  *  Unit test for the date class
3  *
4  * test if the today() function returns the system date
5  ******************************************************
6  *
7  */
8
9 #include "date.h"
10 #include <assert.h>
11
12 int main(int argc, char *argv[])
13 {
14    date d0;
15
16    if (argc >= 2)
17    {
18       String system_date(argv[1]);
19       date d1(system_date);
20
21       if (argc == 3)
22       {
23          // Use UTC
24          d0 = today(false);
25       }
26       else
27       {
28          // Use local time
29          d0 = today();
30       }
31       std::cout << "Date of today() = " << d0 << "\n";
32       assert(d0 == d1);
33    }
34
35    return 0;
36 }
37