Windows "compatibility"

* Makefile changes allowing for cross-compilation
* SRDData: had to rename an enum member from ERROR to ERR because
apparently creating a macro called ERROR is a thing in the windows
headers
* DynLib: ported
* Strings: fixes in toOSString, untested for now
* Fixes in some tests
* TODO list update
This commit is contained in:
Emmanuel BENOîT 2018-06-17 12:39:02 +02:00
parent ae2ad1f8b4
commit 30d8d3057e
9 changed files with 157 additions and 34 deletions

View file

@ -454,37 +454,37 @@ void SRDLexerTest::testIntegers( )
M_CKLS_( 11 );
M_CKTOK_( 0 , INT , 1 , 1 );
CPPUNIT_ASSERT_EQUAL( 0l , list[ 0 ].longValue( ) );
CPPUNIT_ASSERT_EQUAL( int64_t( 0 ) , list[ 0 ].longValue( ) );
M_CKTOK_( 1 , INT , 1 , 3 );
CPPUNIT_ASSERT_EQUAL( 0l , list[ 1 ].longValue( ) );
CPPUNIT_ASSERT_EQUAL( int64_t( 0 ) , list[ 1 ].longValue( ) );
M_CKTOK_( 2 , INT , 1 , 7 );
CPPUNIT_ASSERT_EQUAL( 0l , list[ 2 ].longValue( ) );
CPPUNIT_ASSERT_EQUAL( int64_t( 0 ) , list[ 2 ].longValue( ) );
M_CKTOK_( 3 , INT , 1 , 10 );
CPPUNIT_ASSERT_EQUAL( 1l , list[ 3 ].longValue( ) );
CPPUNIT_ASSERT_EQUAL( int64_t( 1 ) , list[ 3 ].longValue( ) );
M_CKTOK_( 4 , INT , 1 , 12 );
CPPUNIT_ASSERT_EQUAL( -1l , list[ 4 ].longValue( ) );
CPPUNIT_ASSERT_EQUAL( int64_t( -1 ) , list[ 4 ].longValue( ) );
M_CKTOK_( 5 , INT , 1 , 15 );
CPPUNIT_ASSERT_EQUAL( 123l , list[ 5 ].longValue( ) );
CPPUNIT_ASSERT_EQUAL( int64_t( 123 ) , list[ 5 ].longValue( ) );
M_CKTOK_( 6 , INT , 1 , 19 );
CPPUNIT_ASSERT_EQUAL( -123l , list[ 6 ].longValue( ) );
CPPUNIT_ASSERT_EQUAL( int64_t( -123 ) , list[ 6 ].longValue( ) );
M_CKTOK_( 7 , LONG , 1 , 24 );
CPPUNIT_ASSERT_EQUAL( 5000000000l , list[ 7 ].longValue( ) );
CPPUNIT_ASSERT_EQUAL( int64_t( 5000000000 ) , list[ 7 ].longValue( ) );
M_CKTOK_( 8 , LONG , 1 , 35 );
CPPUNIT_ASSERT_EQUAL( -5000000000l , list[ 8 ].longValue( ) );
CPPUNIT_ASSERT_EQUAL( int64_t( -5000000000 ) , list[ 8 ].longValue( ) );
M_CKTOK_( 9 , INT , 1 , 47 );
CPPUNIT_ASSERT_EQUAL( 0l , list[ 9 ].longValue( ) );
CPPUNIT_ASSERT_EQUAL( int64_t( 0 ) , list[ 9 ].longValue( ) );
M_CKTOK_( 10 , INT , 1 , 94 );
CPPUNIT_ASSERT_EQUAL( 123l , list[ 10 ].longValue( ) );
CPPUNIT_ASSERT_EQUAL( int64_t( 123 ) , list[ 10 ].longValue( ) );
}
void SRDLexerTest::testFloatValid( )

View file

@ -537,8 +537,10 @@ void StringsBuilderTest::testAppendUnicode( )
const char t[] = STR; \
const uint32_t sz = sizeof( t ) - 1; \
if ( sz != sbo.size( ) || memcmp( sbo.data( ) , t , sz ) ) { \
const auto x( T_String( sbo ).toOSString( ) ); \
printf( "'%s' | expected '%s'\n" , x.data( ) , STR ); \
char x[ sbo.size( ) + 1 ]; \
x[ sizeof( x ) - 1 ] = 0; \
memcpy( x , sbo.data( ) , sizeof( x ) - 1 ); \
printf( "'%s' | expected '%s'\n" , x , STR ); \
} \
CPPUNIT_ASSERT_EQUAL( sz , sbo.size( ) ); \
CPPUNIT_ASSERT( !memcmp( sbo.data( ) , t , sz ) ); \