[nasm:nasm-2.15.xx-travis] output/outcoff.c: zap timestamp when running tests

nasm-bot for Cyrill Gorcunov gorcunov at gmail.com
Tue Aug 25 09:57:05 PDT 2020


Commit-ID:  523b96dd6f0504f55508b4e54c147d310a85907a
Gitweb:     http://repo.or.cz/w/nasm.git?a=commitdiff;h=523b96dd6f0504f55508b4e54c147d310a85907a
Author:     Cyrill Gorcunov <gorcunov at gmail.com>
AuthorDate: Tue, 25 Aug 2020 19:18:50 +0300
Committer:  Cyrill Gorcunov <gorcunov at gmail.com>
CommitDate: Tue, 25 Aug 2020 19:18:50 +0300

output/outcoff.c: zap timestamp when running tests

When we're running tests we must not fail due to
time stamp difference in a header. Lets zap it if
test run is detected.

Signed-off-by: Cyrill Gorcunov <gorcunov at gmail.com>


---
 output/outcoff.c | 12 +++++++++++-
 1 file changed, 11 insertions(+), 1 deletion(-)

diff --git a/output/outcoff.c b/output/outcoff.c
index 2ecb97fc..6568ac23 100644
--- a/output/outcoff.c
+++ b/output/outcoff.c
@@ -40,6 +40,7 @@
 
 #include "nctype.h"
 #include <time.h>
+#include "ver.h"
 
 #include "nasm.h"
 #include "nasmlib.h"
@@ -935,7 +936,16 @@ static void coff_write(void)
         i = IMAGE_FILE_MACHINE_I386;
     fwriteint16_t(i,                    ofile); /* machine type */
     fwriteint16_t(coff_nsects,               ofile); /* number of sections */
-    fwriteint32_t(time(NULL),           ofile); /* time stamp */
+
+    /*
+     * When running tests we'are comparing binary output
+     * so time should be zapped.
+     */
+    if (nasm_test_run())
+        fwriteint32_t(0, ofile); /* time stamp */
+    else
+        fwriteint32_t(time(NULL), ofile); /* time stamp */
+
     fwriteint32_t(sympos,               ofile);
     fwriteint32_t(coff_nsyms + initsym,      ofile);
     fwriteint16_t(0,                    ofile); /* no optional header */


More information about the Nasm-commits mailing list