mirror of
https://github.com/boykopovar/AnyPS5.git
synced 2026-11-07 13:39:55 +00:00
test(libSceConvertKeycode): check the keyboard type lookup at both int32 limits at compile time
LookUp is constexpr, so static_assert evaluates it for INT32_MIN and INT32_MAX in a constant expression, where signed overflow is an error. With the previous 32-bit subtraction the test file no longer compiles ('overflow in constant expression'); the existing runtime case for 0x80000000 only showed the overflow under UBSan.
This commit is contained in:
1 parent
db8d2bc1c9
commit
89af2b225e
1 file changed
+3
@@ -15,6 +15,9 @@
|
||||
|
||||
static void Require(bool value) { if (!value) std::abort(); }
|
||||
|
||||
static_assert(ImeKeyboardType::LookUp(INT32_MIN, 0, 0) == 0);
|
||||
static_assert(ImeKeyboardType::LookUp(INT32_MAX, 0, 0) == 0);
|
||||
|
||||
static void SetLanguage(const char* value) {
|
||||
#ifdef _WIN32
|
||||
Require(_putenv_s("ANYPS5_LANGUAGE", value != nullptr ? value : "") == 0);
|
||||
|
||||
Reference in new issue
Block a user