Advertisement

test_feature fail, time-related stuff

Started by July 16, 2020 01:32 AM
6 comments, last by WitchLord 3 years, 10 months ago

It seems G++ 8/9/10 doesn't like time-related functions in addons, at least on linux

/.../sdk/add_on/scriptfile/scriptfilesystem.cpp:551:23: error: invalid conversion from ‘__time_t’ {aka ‘long int’} to ‘const time_t*’ {aka ‘const long int*’} [-fpermissive]
  tm *t = localtime(st.st_ctime);
                       ^

While VS2019 compiles just fine, it fails tests for datetime addon

3>AngelScript version: 2.35.0 WIP
3>AngelScript options:  AS_WIN AS_X86
...
3>--- Assert failed ---
3>func: void ExecuteString()
3>mdle: (null)
3>sect: ExecuteString
3>line: 1
3>---------------------
3>Failed on line 68 in C:\...\sdk\tests\test_feature\source\test_addon_datetime.cpp
3>--- Assert failed ---
3>func: void ExecuteString()
3>mdle: (null)
3>sect: ExecuteString
3>line: 1
3>---------------------
3>Failed on line 105 in C:\...\sdk\tests\test_feature\source\test_addon_datetime.cpp

Note: when re-running the test, for some reason fail at line 68 showed up only once while fail at line 105 shows up every time oO

Games are meant to be created, not played...

Thanks. I'll look into these.

I use MSVC2019 myself, and I haven't had any trouble with the datetime add-on or the test. Would it be possible for you to debug this and figure out what is going wrong when running on your system?

AngelCode.com - game development and more - Reference DB - game developer references
AngelScript - free scripting library - BMFont - free bitmap font generator - Tower - free puzzle game

Advertisement

Test fails on `assert(dt.hour == 0)` as value i have after `dt.setTime(0,0,0)` is 23

Test passes if i change system date to 16 march/16 november, which is few weeks before/after DST mess here, see https://www.timeanddate.com/time/change/poland

Test passes if i change system time settings to not adjust for DST automagically.

Test passes if i change system timezone to country without DST mess. I'm guessing you're lucky to always be in such a smart country when running tests :> This one is currently my best (and only) guess why assert could fail for me but not for you.

Games are meant to be created, not played...

Ah, yes. That explains it. I'll try to make sure the code is agnostic of the current DST in whatever timezone the computer is.

DST always complicated. Even more so when trying to determine differences between two time stamps.

AngelCode.com - game development and more - Reference DB - game developer references
AngelScript - free scripting library - BMFont - free bitmap font generator - Tower - free puzzle game

Looks r2664 fixed compilation errors, yay!

That allows to see there is still few tests (not time-related) which fails. Good (?) news is that it happens only with G++ x64, starting with

Failed on line 212 in /.../test_feature/source/test_native_defaultfunc.cpp

Full run (line 405+) https://github.com/rotators/EWAN/runs/895802745#step:6:405

Games are meant to be created, not played...

Thanks for letting me know.

The test_native_defaultfunc.cpp is rather new, and I haven't really tested it on any other platforms than Win32/64. I have some other tests that I need to perform on Linux too, when I get to that I'll make sure that all the tests passes successfully.

AngelCode.com - game development and more - Reference DB - game developer references
AngelScript - free scripting library - BMFont - free bitmap font generator - Tower - free puzzle game

Advertisement

I've fixed the problem with the timezone in rev 2689

Regards,
Andreas

AngelCode.com - game development and more - Reference DB - game developer references
AngelScript - free scripting library - BMFont - free bitmap font generator - Tower - free puzzle game

This topic is closed to new replies.

Advertisement