From: Peter Verthez Date: Mon, 30 Dec 2002 09:31:23 +0000 (+0000) Subject: Test for update of timestamp. X-Git-Url: https://git.dlugolecki.net.pl/?a=commitdiff_plain;ds=inline;h=560a739640bb8ab266e1335afb9a8cef9eb4f1aa;p=gedcom-parse.git Test for update of timestamp. --- diff --git a/t/output/write_gom_allged.ged b/t/output/write_gom_allged.ged index 0fc20a0..e06a2a5 100644 --- a/t/output/write_gom_allged.ged +++ b/t/output/write_gom_allged.ged @@ -22,8 +22,8 @@ 3 DATE 1 JAN 1998 3 COPR Copyright of source data 1 DEST Destination of transmission -1 DATE 1 JAN 1998 -2 TIME 13:57:24.80 +1 DATE 9 SEP 2001 +2 TIME 02:46:40 1 SUBM @SUBMITTER@ 1 SUBN @SUBMISSION@ 1 FILE ALLGED.GED diff --git a/t/output/write_gom_ansel.ged b/t/output/write_gom_ansel.ged index d96689f..d5fc983 100644 --- a/t/output/write_gom_ansel.ged +++ b/t/output/write_gom_ansel.ged @@ -2,6 +2,8 @@ 1 CHAR ASCII 1 SOUR GEDCOM_PARSE 2 VERS 0.20.0 +1 DATE 9 SEP 2001 +2 TIME 02:46:40 1 SUBM @SUBMITTER@ 1 GEDC 2 VERS 5.5 diff --git a/t/output/write_gom_ascii.ged b/t/output/write_gom_ascii.ged index d96689f..d5fc983 100644 --- a/t/output/write_gom_ascii.ged +++ b/t/output/write_gom_ascii.ged @@ -2,6 +2,8 @@ 1 CHAR ASCII 1 SOUR GEDCOM_PARSE 2 VERS 0.20.0 +1 DATE 9 SEP 2001 +2 TIME 02:46:40 1 SUBM @SUBMITTER@ 1 GEDC 2 VERS 5.5 diff --git a/t/output/write_gom_dates.ged b/t/output/write_gom_dates.ged index 57bd1ee..f7c24b0 100644 --- a/t/output/write_gom_dates.ged +++ b/t/output/write_gom_dates.ged @@ -1,6 +1,8 @@ 0 HEAD 1 CHAR ASCII 1 SOUR APPROVED_SOURCE_NAME +1 DATE 9 SEP 2001 +2 TIME 02:46:40 1 SUBM @SUBMITTER@ 1 GEDC 2 VERS 5.5 diff --git a/t/output/write_gom_uhlbomcl.ged b/t/output/write_gom_uhlbomcl.ged index 47621de..cc85a3a 100644 Binary files a/t/output/write_gom_uhlbomcl.ged and b/t/output/write_gom_uhlbomcl.ged differ diff --git a/t/output/write_gom_uhlcl.ged b/t/output/write_gom_uhlcl.ged index 60fb556..c47022d 100644 Binary files a/t/output/write_gom_uhlcl.ged and b/t/output/write_gom_uhlcl.ged differ diff --git a/t/output/write_gom_ulhbomcl.ged b/t/output/write_gom_ulhbomcl.ged index 006ddea..f6df52f 100644 Binary files a/t/output/write_gom_ulhbomcl.ged and b/t/output/write_gom_ulhbomcl.ged differ diff --git a/t/output/write_gom_ulhc.ged b/t/output/write_gom_ulhc.ged index 61392d2..156c3dc 100644 Binary files a/t/output/write_gom_ulhc.ged and b/t/output/write_gom_ulhc.ged differ diff --git a/t/output/write_gom_ulhcl.ged b/t/output/write_gom_ulhcl.ged index 38ef0c6..6a49e23 100644 Binary files a/t/output/write_gom_ulhcl.ged and b/t/output/write_gom_ulhcl.ged differ diff --git a/t/output/write_gom_ulhl.ged b/t/output/write_gom_ulhl.ged index dff7bb3..4f190de 100644 Binary files a/t/output/write_gom_ulhl.ged and b/t/output/write_gom_ulhl.ged differ diff --git a/t/output/write_gom_ulhlc.ged b/t/output/write_gom_ulhlc.ged index 100bcb1..06493c9 100644 Binary files a/t/output/write_gom_ulhlc.ged and b/t/output/write_gom_ulhlc.ged differ diff --git a/t/src/gom_write.c b/t/src/gom_write.c index cb28844..65aef2e 100644 --- a/t/src/gom_write.c +++ b/t/src/gom_write.c @@ -31,6 +31,7 @@ #define WRITE_GEDCOM "gom_write.ged" #define PROG_NAME "writegomtest" #define PROG_VERSION "3.14" +#define TIMESTAMP 1000000000L void gedcom_message_handler(Gedcom_msg_type type, char *msg) { @@ -90,6 +91,8 @@ int update_header(char* encoding) int main(int argc, char* argv[]) { int result; + struct tm* tm_ptr; + time_t tval; int total_conv_fails = 0; char* outfilename = NULL; char* infilename = NULL; @@ -223,6 +226,14 @@ int main(int argc, char* argv[]) if (result == 0) result |= update_header(encoding); } + /* Make sure we get a reproduceable output, in different timezones */ + if (result == 0) { + tval = TIMESTAMP; + tm_ptr = gmtime(&tval); + tm_ptr->tm_isdst = 0; + tval = mktime(tm_ptr); + result = gom_header_update_timestamp(tval); + } if (result == 0) result |= gom_write_file(gedfilename, &total_conv_fails); if (result == 0 && total_conv_fails == 0) {