Closed deajan closed 6 years ago
Hello, I run this every time I build a Windows installer and it passes. Maybe your Windows computer is speaking something other than English? If you want to debug it, you can add printf() lines to utest/test_times.c, just before line 55: printf("expected: '%s', got: '%s'\n", ds[i].str, str);
Indeed, my computer is a French :) I guess all functions where getdatestr is used should be faulty on non English Windows. This can't be true since this would mean that any date comparaisons would be false. I'll definitly look that up in a next compile session.
I think it just means that my tests fail because my tests expect English text. It doesn't mean that the functions are failing. The tests should probably just temporarily set English locales.
Added the debug line, here's my output
expected: 'never', got: 'never'
expected: '1970-01-01 00:16:40', got: '1970-01-01 01:16:40'
98%: Checks: 62, Failures: 1, Errors: 0
/opt/burp/2.1.28/burp-2.1.28/utest/test_times.c:56:F:Core:test_getdatestr:0: Assertion '!strcmp(ds[i].str, str)' failed
I'm using UTC+1. If I happen to use UTC+0, I don't have errors.
In that test, I temporarily set the TZ environment variable on non-Windows, but not for Windows.
Do you know how the test can do a similar thing for Windows?
Found this, will try it: https://msdn.microsoft.com/en-us/library/windows/desktop/ms686206(v=vs.85).aspx
I couldn't get SetEnvironmentVariable to do what I wanted. However, utest.exe runs fine when run from inside cmd.exe like this:
SET TZ=UTC+0
utest.exe
Or from within cygwin like this:
TZ=UTC+0 utest.exe
I will close this issue now, as I think everything is basically OK.
Indeed, I just hope that clients and servers in different timezones won't be affected by any time comparaison issues that may happen.
Btw, works for Windows (in batch hell)
tzutil /g > %TMP%\TZ && set /p TZ=<%TMP%\TZ
tzutil /s UTC
utest.exe
tzutil /g "%TZ%"
It should be OK because time comparisons only happen server side.
For what it worth, there's an error in the windows version of the unit tests.