You've already forked pgbackrest
mirror of
https://github.com/pgbackrest/pgbackrest.git
synced 2025-07-05 00:28:52 +02:00
Use THROW_ON_SYS_ERROR*() to improve code coverage.
There is only one instance in the core code where this helps. It is mostly helpful in the tests. There is an argument to be made that only THROW_SYS_ERROR*() variants should be used in the core code to improve test coverage. If so, that will be the subject of a future commit.
This commit is contained in:
@ -378,8 +378,7 @@ testRun(void)
|
||||
int stdoutSave = dup(STDOUT_FILENO);
|
||||
String *stdoutFile = strNewFmt("%s/stdout.help", testPath());
|
||||
|
||||
if (freopen(strPtr(stdoutFile), "w", stdout) == NULL) // {uncoverable - does not fail}
|
||||
THROW_SYS_ERROR(FileWriteError, "unable to reopen stdout"); // {uncoverable+}
|
||||
THROW_ON_SYS_ERROR(freopen(strPtr(stdoutFile), "w", stdout) == NULL, FileWriteError, "unable to reopen stdout");
|
||||
|
||||
// Not in a test wrapper to avoid writing to stdout
|
||||
cmdHelp();
|
||||
|
Reference in New Issue
Block a user