Changeset cd1d721 for tests


Ignore:
Timestamp:
Jul 18, 2024, 9:58:05 PM (7 days ago)
Author:
Peter A. Buhr <pabuhr@…>
Branches:
master
Children:
e6128959
Parents:
6804f38
Message:

modify time test to set time zone to America/Toronto? so test is repeatable where ever run

File:
1 edited

Legend:

Unmodified
Added
Removed
  • tests/time.cfa

    r6804f38 rcd1d721  
    1010// Created On       : Tue Mar 27 17:24:56 2018
    1111// Last Modified By : Peter A. Buhr
    12 // Last Modified On : Fri Apr 16 14:59:53 2021
    13 // Update Count     : 38
     12// Last Modified On : Thu Jul 18 21:56:01 2024
     13// Update Count     : 64
    1414//
    1515
    1616#include "time.hfa"
    1717#include <fstream.hfa>
     18#include <stdlib.h>                                                                             // putenv
     19
     20extern "C" size_t malloc_unfreed() { return 337; }              // unfreed storage from tzset
    1821
    1922int main() {
     23        // Set fixed time location to obtain repeatable output where ever run.
     24        putenv("TZ=America/Toronto");                                           // set fixed time zone
     25        tzset();                                                                                        // set time zone
     26
    2027        Duration d1 = 3`h, d2 = 2`s, d3 = 3.375`s, d4 = 12`s, d5 = 1`s + 10_000`ns;
    2128        sout | d1 | d2 | d3 | d4 | d5;
Note: See TracChangeset for help on using the changeset viewer.