mirror of
https://github.com/wiiu-env/WiiUPluginSystem.git
synced 2026-05-08 05:59:18 -05:00
Update button combo test plugin
This commit is contained in:
parent
41f4dd55a1
commit
44ba5783e8
|
|
@ -351,7 +351,7 @@ TEST_CASE("C: Creating a press down ex combination works") {
|
|||
}
|
||||
}
|
||||
|
||||
TEST_CASE("Creating a combo fails if combo is empty") {
|
||||
TEST_CASE("Creating two combos with empty combo does not create an conflict") {
|
||||
WUPSButtonCombo_ComboStatus status;
|
||||
WUPSButtonCombo_Error error;
|
||||
|
||||
|
|
@ -363,8 +363,18 @@ TEST_CASE("Creating a combo fails if combo is empty") {
|
|||
status,
|
||||
error);
|
||||
|
||||
REQUIRE(!resOpt.has_value());
|
||||
REQUIRE(error == WUPS_BUTTON_COMBO_ERROR_INVALID_ARGS);
|
||||
REQUIRE(resOpt.has_value());
|
||||
REQUIRE(error == WUPS_BUTTON_COMBO_ERROR_SUCCESS);
|
||||
const auto resOpt1 = WUPSButtonComboAPI::CreateComboPressDown(
|
||||
BASE_LABEL,
|
||||
static_cast<WUPSButtonCombo_Buttons>(0),
|
||||
stubCallback,
|
||||
DEFAULT_CALLBACK_CONTEXT,
|
||||
status,
|
||||
error);
|
||||
|
||||
REQUIRE(resOpt1.has_value());
|
||||
REQUIRE(error == WUPS_BUTTON_COMBO_ERROR_SUCCESS);
|
||||
}
|
||||
|
||||
TEST_CASE("Creating a combo still works if the label is empty") {
|
||||
|
|
@ -1271,36 +1281,6 @@ TEST_CASE("WUPSButtonComboAPI_AddButtonCombo works if status is nullptr") {
|
|||
REQUIRE(res == WUPS_BUTTON_COMBO_ERROR_SUCCESS);
|
||||
}
|
||||
|
||||
TEST_CASE("WUPSButtonComboAPI_AddButtonCombo fails if invalid or empty controller mask is used") {
|
||||
WUPSButtonCombo_ComboOptions options = getDefaultComboOptions();
|
||||
|
||||
WUPSButtonCombo_ComboHandle handle;
|
||||
WUPSButtonCombo_ComboStatus status;
|
||||
|
||||
options.buttonComboOptions.basicCombo.controllerMask = static_cast<WUPSButtonCombo_ControllerTypes>(1 << 12);
|
||||
auto res = WUPSButtonComboAPI_AddButtonCombo(&options, &handle, &status);
|
||||
REQUIRE(res == WUPS_BUTTON_COMBO_ERROR_INVALID_ARGS);
|
||||
|
||||
options.buttonComboOptions.basicCombo.controllerMask = static_cast<WUPSButtonCombo_ControllerTypes>(0);
|
||||
res = WUPSButtonComboAPI_AddButtonCombo(&options, &handle, &status);
|
||||
REQUIRE(res == WUPS_BUTTON_COMBO_ERROR_INVALID_ARGS);
|
||||
}
|
||||
|
||||
TEST_CASE("WUPSButtonComboAPI_AddButtonCombo fails if invalid or empty button combo is used") {
|
||||
WUPSButtonCombo_ComboOptions options = getDefaultComboOptions();
|
||||
|
||||
WUPSButtonCombo_ComboHandle handle;
|
||||
WUPSButtonCombo_ComboStatus status;
|
||||
|
||||
options.buttonComboOptions.basicCombo.combo = static_cast<WUPSButtonCombo_Buttons>(0);
|
||||
auto res = WUPSButtonComboAPI_AddButtonCombo(&options, &handle, &status);
|
||||
REQUIRE(res == WUPS_BUTTON_COMBO_ERROR_INVALID_ARGS);
|
||||
|
||||
options.buttonComboOptions.basicCombo.combo = static_cast<WUPSButtonCombo_Buttons>(0x400000);
|
||||
res = WUPSButtonComboAPI_AddButtonCombo(&options, &handle, &status);
|
||||
REQUIRE(res == WUPS_BUTTON_COMBO_ERROR_INVALID_ARGS);
|
||||
}
|
||||
|
||||
TEST_CASE("WUPSButtonComboAPI_AddButtonCombo fails if callback is missing") {
|
||||
WUPSButtonCombo_ComboOptions options = getDefaultComboOptions();
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user