mirror of
https://github.com/thunderbrewhq/squall.git
synced 2026-02-04 00:49:08 +00:00
feat(test): support more storm.dll versions
This commit is contained in:
parent
5ec28d3aac
commit
48a2315122
3 changed files with 19 additions and 4 deletions
|
|
@ -27,5 +27,7 @@ To use a different version of Storm.dll, use the following arguments in the cmak
|
||||||
| Arguments | Games |
|
| Arguments | Games |
|
||||||
|-----------|-------|
|
|-----------|-------|
|
||||||
|`-DWHOA_STORMDLL_VERSION=2016`| Starcraft 1.17 |
|
|`-DWHOA_STORMDLL_VERSION=2016`| Starcraft 1.17 |
|
||||||
|`-DWHOA_STORMDLL_VERSION=2009`| Starcraft 1.16.1 |
|
|`-DWHOA_STORMDLL_VERSION=2007`| Starcraft 1.15.0 ~ 1.16.1 |
|
||||||
|`-DWHOA_STORMDLL_VERSION=2003`| Starcraft 1.10 ~ 1.16.0, Diablo II 1.10 ~ 1.13d |
|
|`-DWHOA_STORMDLL_VERSION=2003`| Starcraft 1.10 ~ 1.14.0, Diablo II 1.10 ~ 1.13d |
|
||||||
|
|`-DWHOA_STORMDLL_VERSION=2000`| Diablo 1.09, Starcraft 1.08 ~ Starcraft 1.09b, Diablo II 1.06 ~ Diablo II 1.09d, Warcraft II: BNE 2.02.1 |
|
||||||
|
|`-DWHOA_STORMDLL_VERSION=1999`| Diablo 1.08, Diablo II 1.0 ~ Diablo II 1.05b |
|
||||||
|
|
|
||||||
|
|
@ -9,8 +9,11 @@ if(WHOA_TEST_STORMDLL)
|
||||||
Region.cpp
|
Region.cpp
|
||||||
String.cpp
|
String.cpp
|
||||||
Test.cpp
|
Test.cpp
|
||||||
Unicode.cpp
|
|
||||||
)
|
)
|
||||||
|
|
||||||
|
if(WHOA_STORMDLL_VERSION GREATER_EQUAL 2003)
|
||||||
|
list(APPEND TEST_SOURCES Unicode.cpp)
|
||||||
|
endif()
|
||||||
else()
|
else()
|
||||||
file(GLOB TEST_SOURCES
|
file(GLOB TEST_SOURCES
|
||||||
"*.cpp"
|
"*.cpp"
|
||||||
|
|
|
||||||
|
|
@ -454,6 +454,7 @@ TEST_CASE("SStrHashHT", "[string]") {
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#if !defined(WHOA_STORMDLL_VERSION) || WHOA_STORMDLL_VERSION >= 2000
|
||||||
TEST_CASE("SStrHash64", "[string]") {
|
TEST_CASE("SStrHash64", "[string]") {
|
||||||
#if defined(WHOA_SSTRHASH64_SUBTRACTS)
|
#if defined(WHOA_SSTRHASH64_SUBTRACTS)
|
||||||
SECTION("hashes strings with case insensitivity") {
|
SECTION("hashes strings with case insensitivity") {
|
||||||
|
|
@ -627,6 +628,7 @@ TEST_CASE("SStrHash64", "[string]") {
|
||||||
CHECK(hash == seed);
|
CHECK(hash == seed);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
TEST_CASE("SStrLen", "[string]") {
|
TEST_CASE("SStrLen", "[string]") {
|
||||||
SECTION("calculates string length correctly") {
|
SECTION("calculates string length correctly") {
|
||||||
|
|
@ -638,6 +640,7 @@ TEST_CASE("SStrLen", "[string]") {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#if !defined(WHOA_STORMDLL_VERSION) || WHOA_STORMDLL_VERSION >= 2000
|
||||||
TEST_CASE("SStrLower", "[string]") {
|
TEST_CASE("SStrLower", "[string]") {
|
||||||
SECTION("rewrites uppercase string to lowercase correctly") {
|
SECTION("rewrites uppercase string to lowercase correctly") {
|
||||||
char string[] = "FOOBAR";
|
char string[] = "FOOBAR";
|
||||||
|
|
@ -661,6 +664,7 @@ TEST_CASE("SStrLower", "[string]") {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// In older versions this doesn't have a return value
|
||||||
TEST_CASE("SStrPack", "[string]") {
|
TEST_CASE("SStrPack", "[string]") {
|
||||||
SECTION("truncates dest correctly when first byte in source is null") {
|
SECTION("truncates dest correctly when first byte in source is null") {
|
||||||
char dest[10] = {};
|
char dest[10] = {};
|
||||||
|
|
@ -706,6 +710,7 @@ TEST_CASE("SStrPack", "[string]") {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// In older versions this doesn't have a return value
|
||||||
TEST_CASE("SStrPrintf", "[string]") {
|
TEST_CASE("SStrPrintf", "[string]") {
|
||||||
SECTION("fills dest with formatted string") {
|
SECTION("fills dest with formatted string") {
|
||||||
char dest[100] = {};
|
char dest[100] = {};
|
||||||
|
|
@ -797,8 +802,9 @@ TEST_CASE("SStrVPrintf", "[string]") {
|
||||||
REQUIRE(!SStrCmp(dest, ""));
|
REQUIRE(!SStrCmp(dest, ""));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
#if !defined(WHOA_STORMDLL_VERSION) || WHOA_STORMDLL_VERSION >= 2009
|
#if !defined(WHOA_STORMDLL_VERSION) || WHOA_STORMDLL_VERSION >= 2007
|
||||||
TEST_CASE("SStrStr", "[string]") {
|
TEST_CASE("SStrStr", "[string]") {
|
||||||
char string[] = "foobar";
|
char string[] = "foobar";
|
||||||
|
|
||||||
|
|
@ -1020,6 +1026,7 @@ TEST_CASE("SStrTokenize", "[string]") {
|
||||||
}
|
}
|
||||||
|
|
||||||
#if !defined(WHOA_STORMDLL_VERSION) || WHOA_STORMDLL_VERSION >= 2016
|
#if !defined(WHOA_STORMDLL_VERSION) || WHOA_STORMDLL_VERSION >= 2016
|
||||||
|
// In older versions these are broken
|
||||||
TEST_CASE("SStrToDouble", "[string]") {
|
TEST_CASE("SStrToDouble", "[string]") {
|
||||||
SECTION("converts empty string to double") {
|
SECTION("converts empty string to double") {
|
||||||
auto result = SStrToDouble("");
|
auto result = SStrToDouble("");
|
||||||
|
|
@ -1098,6 +1105,7 @@ TEST_CASE("SStrToDouble", "[string]") {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// In older versions these are broken
|
||||||
TEST_CASE("SStrToFloat", "[string]") {
|
TEST_CASE("SStrToFloat", "[string]") {
|
||||||
SECTION("converts empty string to float") {
|
SECTION("converts empty string to float") {
|
||||||
auto result = SStrToFloat("");
|
auto result = SStrToFloat("");
|
||||||
|
|
@ -1269,6 +1277,7 @@ TEST_CASE("SStrToUnsigned", "[string]") {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#if !defined(WHOA_STORMDLL_VERSION) || WHOA_STORMDLL_VERSION >= 2000
|
||||||
TEST_CASE("SStrUpper", "[string]") {
|
TEST_CASE("SStrUpper", "[string]") {
|
||||||
SECTION("rewrites lowercase string to uppercase correctly") {
|
SECTION("rewrites lowercase string to uppercase correctly") {
|
||||||
char string[] = "foobar";
|
char string[] = "foobar";
|
||||||
|
|
@ -1291,3 +1300,4 @@ TEST_CASE("SStrUpper", "[string]") {
|
||||||
REQUIRE(!SStrCmp(string, ""));
|
REQUIRE(!SStrCmp(string, ""));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue