1
0
mirror of https://github.com/pgbackrest/pgbackrest.git synced 2025-07-05 00:28:52 +02:00

Replace double type with time in config module.

The C code does not use doubles to represent seconds like the Perl code did so time can be represented as an integer which reduces the number of data types that config has to understand.

Also remove Variant doubles since they are no longer used.

Note that not all double code was removed since we still need to display times to the user in seconds and it is possible for the times to be fractional. In the future this will likely be simplified by storing the original user input and using that value when the time needs to be displayed.
This commit is contained in:
David Steele
2020-12-09 08:59:51 -05:00
committed by GitHub
parent a137c6baaa
commit 87996558d2
43 changed files with 214 additions and 450 deletions

View File

@ -71,11 +71,11 @@ testRun(void)
// *****************************************************************************************************************************
if (testBegin("helpRenderValue()"))
{
TEST_RESULT_STR_Z(helpRenderValue(varNewBool(true)), "y", "boolean y");
TEST_RESULT_STR_Z(helpRenderValue(varNewBool(false)), "n", "boolean n");
TEST_RESULT_STR_Z(helpRenderValue(varNewStrZ("test-string")), "test-string", "string");
TEST_RESULT_STR_Z(helpRenderValue(varNewDbl(1.234)), "1.234", "double");
TEST_RESULT_STR_Z(helpRenderValue(varNewInt(1234)), "1234", "int");
TEST_RESULT_STR_Z(helpRenderValue(varNewBool(true), cfgDefOptTypeBoolean), "y", "boolean y");
TEST_RESULT_STR_Z(helpRenderValue(varNewBool(false), cfgDefOptTypeBoolean), "n", "boolean n");
TEST_RESULT_STR_Z(helpRenderValue(varNewStrZ("test-string"), cfgDefOptTypeString), "test-string", "string");
TEST_RESULT_STR_Z(helpRenderValue(varNewInt64(1234), cfgDefOptTypeInteger), "1234", "int");
TEST_RESULT_STR_Z(helpRenderValue(varNewInt64(1234000), cfgDefOptTypeTime), "1234", "time");
}
// *****************************************************************************************************************************