Test for update of timestamp.
authorPeter Verthez <Peter.Verthez@advalvas.be>
Mon, 30 Dec 2002 09:31:23 +0000 (09:31 +0000)
committerPeter Verthez <Peter.Verthez@advalvas.be>
Mon, 30 Dec 2002 09:31:23 +0000 (09:31 +0000)
12 files changed:
t/output/write_gom_allged.ged
t/output/write_gom_ansel.ged
t/output/write_gom_ascii.ged
t/output/write_gom_dates.ged
t/output/write_gom_uhlbomcl.ged
t/output/write_gom_uhlcl.ged
t/output/write_gom_ulhbomcl.ged
t/output/write_gom_ulhc.ged
t/output/write_gom_ulhcl.ged
t/output/write_gom_ulhl.ged
t/output/write_gom_ulhlc.ged
t/src/gom_write.c

index 0fc20a05b22cd976d3292ec2a5d912c712913f77..e06a2a59695909c1b205c671eed5bd3a2695c29c 100644 (file)
@@ -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
index d96689fd9837f29ee1f7cbff37a12a7449c35675..d5fc9838a3b3b95efc1db1e5db8c7631f67fe782 100644 (file)
@@ -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
index d96689fd9837f29ee1f7cbff37a12a7449c35675..d5fc9838a3b3b95efc1db1e5db8c7631f67fe782 100644 (file)
@@ -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
index 57bd1eea7384405f147bc0288a7be22ffd65fa2c..f7c24b0901865760dc1207b8816c418bca550d95 100644 (file)
@@ -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
index 47621de737afa8c0f5dc6082631af9ec90aeb9f4..cc85a3ab79f3d374f569c0ec81d97f13a2cc5cee 100644 (file)
Binary files a/t/output/write_gom_uhlbomcl.ged and b/t/output/write_gom_uhlbomcl.ged differ
index 60fb5567227c2a2e2c525b629d70edc7895a9271..c47022d24046f54d3897d002c394b09746d46040 100644 (file)
Binary files a/t/output/write_gom_uhlcl.ged and b/t/output/write_gom_uhlcl.ged differ
index 006ddea07062ec2ab1d3906847a1eebf931392df..f6df52f90a136d5b73761ff3620e567bf0cf0c41 100644 (file)
Binary files a/t/output/write_gom_ulhbomcl.ged and b/t/output/write_gom_ulhbomcl.ged differ
index 61392d20fac8dbe3f0d3d2d97241af4086d4909a..156c3dc170503941a5a97c14aa16bf7dcf4ecee8 100644 (file)
Binary files a/t/output/write_gom_ulhc.ged and b/t/output/write_gom_ulhc.ged differ
index 38ef0c626523528d8b42e2981006055db38329c1..6a49e231989e4d41d3aa6b6b5930ae75cb442298 100644 (file)
Binary files a/t/output/write_gom_ulhcl.ged and b/t/output/write_gom_ulhcl.ged differ
index dff7bb3b14f798cef323ad161992799348e777f3..4f190de68b44648c2bff21fdab7bac4379de60a9 100644 (file)
Binary files a/t/output/write_gom_ulhl.ged and b/t/output/write_gom_ulhl.ged differ
index 100bcb14e3744ef9bf48db7f0f535d55348c09ba..06493c948e974f87dc1fdb9cf9f7c1d866428c86 100644 (file)
Binary files a/t/output/write_gom_ulhlc.ged and b/t/output/write_gom_ulhlc.ged differ
index cb28844aa81f08b5d96dda6f885c992a27015f6d..65aef2e597d3438f2568d269e511c76966b5bcf5 100644 (file)
@@ -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) {