diff options
| author | Jan Trencansky <jan.trencansky@protonmail.com> | 2026-11-24 18:48:12 -0500 |
|---|---|---|
| committer | Jan Trencansky <jan.trencansky@protonmail.com> | 2026-11-24 18:48:12 -0500 |
| commit | fb2afdccc2314d7b5a59fac10e6d6df7f5df35ab (patch) | |
| tree | 9e0b7e2e39b42823f148d135ce781e57fab52155 /runtime/test/mods_test.cpp | |
| parent | 862890c893eb19eb39eb2fd95e7786e42ff4b18c (diff) | |
| parent | 864337351bc11a250db77c2fcdd3ba6f1d0f455f (diff) | |
Merge main into RT-QUEUE18 (#403)
Merged on top of the merge made for #396 (main 507029d1e plus RT-QUEUE35,
RT-ALLOC9 and RT-LIST139). No conflicts.
Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Diffstat (limited to 'runtime/test/mods_test.cpp')
| -rw-r--r-- | runtime/test/mods_test.cpp | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/runtime/test/mods_test.cpp b/runtime/test/mods_test.cpp index a29979b25..e95bc4e16 100644 --- a/runtime/test/mods_test.cpp +++ b/runtime/test/mods_test.cpp | |||
| @@ -41,6 +41,9 @@ int main() { | |||
| 41 | check(!parse_model_id("0x123456789", id), "a hash wider than 32 bits is refused"); | 41 | check(!parse_model_id("0x123456789", id), "a hash wider than 32 bits is refused"); |
| 42 | check(!parse_model_id("0xZZ", id), "a malformed hash is refused"); | 42 | check(!parse_model_id("0xZZ", id), "a malformed hash is refused"); |
| 43 | check(!parse_model_id("", id), "an empty name is refused"); | 43 | check(!parse_model_id("", id), "an empty name is refused"); |
| 44 | id = 0xCAFEBABEu; | ||
| 45 | check(!parse_model_id("0x", id) && id == 0xCAFEBABEu, "a bare 0x prefix is refused"); | ||
| 46 | check(!parse_model_id("0X", id) && id == 0xCAFEBABEu, "a bare 0X prefix is refused"); | ||
| 44 | 47 | ||
| 45 | Mod mod; | 48 | Mod mod; |
| 46 | std::string error; | 49 | std::string error; |
| @@ -53,6 +56,8 @@ int main() { | |||
| 53 | "a condition the runtime cannot honour yet is refused, not ignored"); | 56 | "a condition the runtime cannot honour yet is refused, not ignored"); |
| 54 | check(!parse_mod(R"({"archetype_swaps":[{"from":"cs_mandy","to":"0xD7C0CDFF"}]})", "m", mod, error), | 57 | check(!parse_mod(R"({"archetype_swaps":[{"from":"cs_mandy","to":"0xD7C0CDFF"}]})", "m", mod, error), |
| 55 | "a swap of a model with itself is refused"); | 58 | "a swap of a model with itself is refused"); |
| 59 | check(!parse_mod(R"({"archetype_swaps":[{"from":"0x","to":"cs_mandy"}]})", "m", mod, error), | ||
| 60 | "a bare 0x prefix in an archetype swap is refused"); | ||
| 56 | check(!parse_mod(R"({"enabled":"yes"})", "m", mod, error), "\"enabled\" must be a boolean"); | 61 | check(!parse_mod(R"({"enabled":"yes"})", "m", mod, error), "\"enabled\" must be a boolean"); |
| 57 | check(!parse_mod("[1,2]", "m", mod, error), "a manifest that is not an object is refused"); | 62 | check(!parse_mod("[1,2]", "m", mod, error), "a manifest that is not an object is refused"); |
| 58 | check(parse_mod("{}", "folder_name", mod, error) && mod.name == "folder_name", "the name defaults to the folder"); | 63 | check(parse_mod("{}", "folder_name", mod, error) && mod.name == "folder_name", "the name defaults to the folder"); |