mirror of
https://github.com/bkaradzic/bx.git
synced 2026-02-17 12:42:34 +01:00
Fixed unit test build.
This commit is contained in:
@@ -35,7 +35,7 @@ project "UnitTest++"
|
|||||||
"../3rdparty/UnitTest++/src/Posix/**.h",
|
"../3rdparty/UnitTest++/src/Posix/**.h",
|
||||||
}
|
}
|
||||||
|
|
||||||
configuration { "mingw or vs*" }
|
configuration { "mingw* or vs*" }
|
||||||
files {
|
files {
|
||||||
"../3rdparty/UnitTest++/src/Win32/**.cpp",
|
"../3rdparty/UnitTest++/src/Win32/**.cpp",
|
||||||
"../3rdparty/UnitTest++/src/Win32/**.h",
|
"../3rdparty/UnitTest++/src/Win32/**.h",
|
||||||
|
|||||||
@@ -125,7 +125,7 @@ TEST(float4_compare)
|
|||||||
{
|
{
|
||||||
float4_check_uint32("cmpeq"
|
float4_check_uint32("cmpeq"
|
||||||
, float4_cmpeq(float4_ld(1.0f, 2.0f, 3.0f, 4.0f), float4_ld(0.0f, 2.0f, 0.0f, 3.0f) )
|
, float4_cmpeq(float4_ld(1.0f, 2.0f, 3.0f, 4.0f), float4_ld(0.0f, 2.0f, 0.0f, 3.0f) )
|
||||||
, 0, -1, 0, 0
|
, 0, 0xffffffff, 0, 0
|
||||||
);
|
);
|
||||||
|
|
||||||
float4_check_uint32("cmplt"
|
float4_check_uint32("cmplt"
|
||||||
@@ -135,59 +135,59 @@ TEST(float4_compare)
|
|||||||
|
|
||||||
float4_check_uint32("cmple"
|
float4_check_uint32("cmple"
|
||||||
, float4_cmple(float4_ld(1.0f, 2.0f, 3.0f, 4.0f), float4_ld(0.0f, 2.0f, 0.0f, 3.0f) )
|
, float4_cmple(float4_ld(1.0f, 2.0f, 3.0f, 4.0f), float4_ld(0.0f, 2.0f, 0.0f, 3.0f) )
|
||||||
, 0, -1, 0, 0
|
, 0, 0xffffffff, 0, 0
|
||||||
);
|
);
|
||||||
|
|
||||||
float4_check_uint32("cmpgt"
|
float4_check_uint32("cmpgt"
|
||||||
, float4_cmpgt(float4_ld(1.0f, 2.0f, 3.0f, 4.0f), float4_ld(0.0f, 2.0f, 0.0f, 3.0f) )
|
, float4_cmpgt(float4_ld(1.0f, 2.0f, 3.0f, 4.0f), float4_ld(0.0f, 2.0f, 0.0f, 3.0f) )
|
||||||
, -1, 0, -1, -1
|
, 0xffffffff, 0, 0xffffffff, 0xffffffff
|
||||||
);
|
);
|
||||||
|
|
||||||
float4_check_uint32("cmpge"
|
float4_check_uint32("cmpge"
|
||||||
, float4_cmpge(float4_ld(1.0f, 2.0f, 3.0f, 4.0f), float4_ld(0.0f, 2.0f, 0.0f, 3.0f) )
|
, float4_cmpge(float4_ld(1.0f, 2.0f, 3.0f, 4.0f), float4_ld(0.0f, 2.0f, 0.0f, 3.0f) )
|
||||||
, -1, -1, -1, -1
|
, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff
|
||||||
);
|
);
|
||||||
|
|
||||||
float4_check_uint32("icmpeq"
|
float4_check_uint32("icmpeq"
|
||||||
, float4_icmpeq(float4_ild(0, 1, 2, 3), float4_ild(0, -2, 1, 3) )
|
, float4_icmpeq(float4_ild(0, 1, 2, 3), float4_ild(0, uint32_t(-2), 1, 3) )
|
||||||
, -1, 0, 0, -1
|
, 0xffffffff, 0, 0, 0xffffffff
|
||||||
);
|
);
|
||||||
|
|
||||||
float4_check_uint32("icmplt"
|
float4_check_uint32("icmplt"
|
||||||
, float4_icmplt(float4_ild(0, 1, 2, 3), float4_ild(0, -2, 1, 3) )
|
, float4_icmplt(float4_ild(0, 1, 2, 3), float4_ild(0, uint32_t(-2), 1, 3) )
|
||||||
, 0, 0, 0, 0
|
, 0, 0, 0, 0
|
||||||
);
|
);
|
||||||
|
|
||||||
float4_check_uint32("icmpgt"
|
float4_check_uint32("icmpgt"
|
||||||
, float4_icmpgt(float4_ild(0, 1, 2, 3), float4_ild(0, -2, 1, 3) )
|
, float4_icmpgt(float4_ild(0, 1, 2, 3), float4_ild(0, uint32_t(-2), 1, 3) )
|
||||||
, 0, -1, -1, 0
|
, 0, 0xffffffff, 0xffffffff, 0
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
TEST(float4_test)
|
TEST(float4_test)
|
||||||
{
|
{
|
||||||
float4_check_bool("test_any_xyzw"
|
float4_check_bool("test_any_xyzw"
|
||||||
, float4_test_any_xyzw(float4_ild(-1, 0, 0, 0) )
|
, float4_test_any_xyzw(float4_ild(0xffffffff, 0, 0, 0) )
|
||||||
, true
|
, true
|
||||||
);
|
);
|
||||||
|
|
||||||
float4_check_bool("test_all_xyzw"
|
float4_check_bool("test_all_xyzw"
|
||||||
, float4_test_all_xyzw(float4_ild(-1, 0, -1, 0) )
|
, float4_test_all_xyzw(float4_ild(0xffffffff, 0, 0xffffffff, 0) )
|
||||||
, false
|
, false
|
||||||
);
|
);
|
||||||
|
|
||||||
float4_check_bool("test_all_xyzw"
|
float4_check_bool("test_all_xyzw"
|
||||||
, float4_test_all_xyzw(float4_ild(-1, -1, -1, -1) )
|
, float4_test_all_xyzw(float4_ild(0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff) )
|
||||||
, true
|
, true
|
||||||
);
|
);
|
||||||
|
|
||||||
float4_check_bool("test_all_xw"
|
float4_check_bool("test_all_xw"
|
||||||
, float4_test_all_xw(float4_ild(-1, 0, 0, -1) )
|
, float4_test_all_xw(float4_ild(0xffffffff, 0, 0, 0xffffffff) )
|
||||||
, true
|
, true
|
||||||
);
|
);
|
||||||
|
|
||||||
float4_check_bool("test_all_xzw"
|
float4_check_bool("test_all_xzw"
|
||||||
, float4_test_all_xzw(float4_ild(-1, 0, 0, -1) )
|
, float4_test_all_xzw(float4_ild(0xffffffff, 0, 0, 0xffffffff) )
|
||||||
, false
|
, false
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
@@ -200,13 +200,13 @@ TEST(float4_load)
|
|||||||
);
|
);
|
||||||
|
|
||||||
float4_check_int32("ild"
|
float4_check_int32("ild"
|
||||||
, float4_ild(-1, 0, 1, 2)
|
, float4_ild(uint32_t(-1), 0, 1, 2)
|
||||||
, -1, 0, 1, 2
|
, uint32_t(-1), 0, 1, 2
|
||||||
);
|
);
|
||||||
|
|
||||||
float4_check_int32("ild"
|
float4_check_int32("ild"
|
||||||
, float4_ild(-1, -2, -3, -4)
|
, float4_ild(uint32_t(-1), uint32_t(-2), uint32_t(-3), uint32_t(-4) )
|
||||||
, -1, -2, -3, -4
|
, uint32_t(-1), uint32_t(-2), uint32_t(-3), uint32_t(-4)
|
||||||
);
|
);
|
||||||
|
|
||||||
float4_check_uint32("zero", float4_zero()
|
float4_check_uint32("zero", float4_zero()
|
||||||
@@ -255,17 +255,17 @@ TEST(float4)
|
|||||||
|
|
||||||
float4_check_uint32("or "
|
float4_check_uint32("or "
|
||||||
, float4_or(float4_isplat(0x55555555), float4_isplat(0xaaaaaaaa) )
|
, float4_or(float4_isplat(0x55555555), float4_isplat(0xaaaaaaaa) )
|
||||||
, -1, -1, -1, -1
|
, uint32_t(-1), uint32_t(-1), uint32_t(-1), uint32_t(-1)
|
||||||
);
|
);
|
||||||
|
|
||||||
float4_check_uint32("xor"
|
float4_check_uint32("xor"
|
||||||
, float4_or(float4_isplat(0x55555555), float4_isplat(0xaaaaaaaa) )
|
, float4_or(float4_isplat(0x55555555), float4_isplat(0xaaaaaaaa) )
|
||||||
, -1, -1, -1, -1
|
, uint32_t(-1), uint32_t(-1), uint32_t(-1), uint32_t(-1)
|
||||||
);
|
);
|
||||||
|
|
||||||
float4_check_int32("imin"
|
float4_check_int32("imin"
|
||||||
, float4_imin(float4_ild(0, 1, 2, 3), float4_ild(-1, 2, -2, 1) )
|
, float4_imin(float4_ild(0, 1, 2, 3), float4_ild(uint32_t(-1), 2, uint32_t(-2), 1) )
|
||||||
, -1, 1, -2, 1
|
, uint32_t(-1), 1, uint32_t(-2), 1
|
||||||
);
|
);
|
||||||
|
|
||||||
float4_check_float("min"
|
float4_check_float("min"
|
||||||
@@ -274,7 +274,7 @@ TEST(float4)
|
|||||||
);
|
);
|
||||||
|
|
||||||
float4_check_int32("imax"
|
float4_check_int32("imax"
|
||||||
, float4_imax(float4_ild(0, 1, 2, 3), float4_ild(-1, 2, -2, 1) )
|
, float4_imax(float4_ild(0, 1, 2, 3), float4_ild(uint32_t(-1), 2, uint32_t(-2), 1) )
|
||||||
, 0, 2, 2, 3
|
, 0, 2, 2, 3
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|||||||
@@ -12,17 +12,17 @@ TEST(commandLine)
|
|||||||
{
|
{
|
||||||
const char* args[] =
|
const char* args[] =
|
||||||
{
|
{
|
||||||
"-s"
|
"-s",
|
||||||
"--long",
|
"--long",
|
||||||
};
|
};
|
||||||
|
|
||||||
bx::CommandLine cmdLine(BX_COUNTOF(args), args);
|
bx::CommandLine cmdLine(BX_COUNTOF(args), args);
|
||||||
|
|
||||||
CHECK(NULL != cmdLine.findOption("long") );
|
CHECK(cmdLine.hasArg("long") );
|
||||||
CHECK(NULL != cmdLine.findOption('s') );
|
CHECK(cmdLine.hasArg('s') );
|
||||||
|
|
||||||
// non-existing argument
|
// non-existing argument
|
||||||
CHECK(NULL == cmdLine.findOption('x') );
|
CHECK(!cmdLine.hasArg('x') );
|
||||||
}
|
}
|
||||||
|
|
||||||
TEST(tokenizeCommandLine)
|
TEST(tokenizeCommandLine)
|
||||||
|
|||||||
Reference in New Issue
Block a user