1
0
mirror of https://github.com/pgbackrest/pgbackrest.git synced 2025-02-21 19:48:29 +02:00

Use boolean variant constants where possible instead of redeclaring.

This commit is contained in:
David Steele 2023-05-02 09:37:42 +03:00
parent 822f2a5842
commit 9637d94490
4 changed files with 5 additions and 5 deletions

View File

@ -84,8 +84,8 @@ restorePathValidate(void)
strZ(cfgOptionDisplay(cfgOptPgPath)));
// Disable delta and force so restore will fail if the directories are not empty
cfgOptionSet(cfgOptDelta, cfgSourceDefault, VARBOOL(false));
cfgOptionSet(cfgOptForce, cfgSourceDefault, VARBOOL(false));
cfgOptionSet(cfgOptDelta, cfgSourceDefault, BOOL_FALSE_VAR);
cfgOptionSet(cfgOptForce, cfgSourceDefault, BOOL_FALSE_VAR);
}
}
MEM_CONTEXT_TEMP_END();

View File

@ -160,7 +160,7 @@ testRun(void)
// -------------------------------------------------------------------------------------------------------------------------
TEST_TITLE("recurse");
cfgOptionSet(cfgOptRecurse, cfgSourceParam, VARBOOL(true));
cfgOptionSet(cfgOptRecurse, cfgSourceParam, BOOL_TRUE_VAR);
output = bufNew(0);
cfgOptionSet(cfgOptOutput, cfgSourceParam, VARUINT64(CFGOPTVAL_OUTPUT_TEXT));

View File

@ -31,7 +31,7 @@ testRun(void)
TEST_RESULT_BOOL(varBool(BOOL_FALSE_VAR), false, "false bool variant");
// -------------------------------------------------------------------------------------------------------------------------
TEST_RESULT_BOOL(varBoolForce(VARBOOL(false)), false, "force bool to bool");
TEST_RESULT_BOOL(varBoolForce(BOOL_FALSE_VAR), false, "force bool to bool");
TEST_RESULT_BOOL(varBoolForce(VARINT(1)), true, "force int to bool");
TEST_RESULT_BOOL(varBoolForce(VARUINT(0)), false, "force uint to bool");
TEST_RESULT_BOOL(varBoolForce(VARINT64(false)), false, "force int64 to bool");

View File

@ -1991,7 +1991,7 @@ testRun(void)
// -------------------------------------------------------------------------------------------------------------------------
TEST_TITLE("cfgOptionSet() and cfgOptionIdxSet()");
TEST_RESULT_VOID(cfgOptionSet(cfgOptForce, cfgSourceParam, VARBOOL(false)), "set boolean");
TEST_RESULT_VOID(cfgOptionSet(cfgOptForce, cfgSourceParam, BOOL_FALSE_VAR), "set boolean");
TEST_RESULT_BOOL(cfgOptionBool(cfgOptForce), false, "check boolean");
TEST_RESULT_VOID(cfgOptionSet(cfgOptProtocolTimeout, cfgSourceParam, VARINT64(1000)), "set protocol-timeout to 1");