Advertisement

Updated test_feature cmake config

Started by June 23, 2020 04:33 PM
4 comments, last by WitchLord 4 years, 5 months ago

Looks it wasn't touched since some time, so here's up-to-date version; would be nice to have it in upstream.

For svn r2649 / git sha b9a40739c9d6709b5d4568faf7a78cc47950e9b4 (codecat mirror)

Whole file https://fodev.net/pastebin/?u=as-test-feature-full

Diff only https://fodev.net/pastebin/?u=as-test-feature-diff

---

PS: test_float fails on my setup; 32bit Windows with G++ (MinGW)

AngelScript version: 2.35.0 WIP
AngelScript options:  AS_WIN AS_X86

...

--- Assert failed ---
func: void ExecuteString()
mdle: (null)
sect: ExecuteString
line: 9
---------------------
Failed on line 146 in C:\...\AngelScript\sdk\tests\test_feature\source\test_float.cpp
--------------------------------------------
One of the tests failed, see details above.

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

Thanks. I'll have this updated.

The test_float is probably failing due to the default formatting of floats by printf.

#if defined(__GNUC__) && !defined(_WIN32) || _MSC_VER >= 1900 || __GNUC__ >= 8
								  "assert( s == '3e+38' ); \n"
#else
								  "assert( s == '3e+038' ); \n"
#endif
								  "f = 1.175494351e-38f; \n"
								  "s = formatFloat(f, 'e'); \n"
#if defined(__GNUC__) && !defined(_WIN32) || _MSC_VER >= 1900 || __GNUC__ >= 8
								  "assert( s == '1e-38' ); \n"
#else
								  "assert( s == '1e-038' ); \n"
#endif

Can you check how it is formatted on your setup? And what GNUC version your MinGW is built from?

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

cmakefile changes checked in

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

__GNUC__ -> 9
formatFloat(1.79769313486231e+308, "e", 0, 0) -> 2e+308
formatFloat(2.22507385850720e-308, "e", 0, 0) -> 2e-308
formatFloat(3.402823466e+38f, "e", 0, 0) -> 3e+038
formatFloat(1.175494351e-38f, "e", 0, 0) -> 1e-038
$ ../mingw/bin/g++ --version
g++.exe (MinGW.org GCC Build-20200227-1) 9.2.0

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

Thanks. It seems they've changed the default formatting again :(

I think I'll just change the test to accept both possibilities.

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