1
0
mirror of https://github.com/pgbackrest/pgbackrest.git synced 2025-07-03 00:26:59 +02:00

Make Valgrind return an error even when a non-fatal issue is detected.

By default Valgrind does not exit with an error code when a non-fatal error is detected, e.g. unfreed memory.  Use the --error-exitcode option to enabled this behavior.

Update some minor issues discovered in the tests as a result.  Luckily, no issues were missed in the core code.
This commit is contained in:
David Steele
2018-09-07 16:50:01 -07:00
parent faaa9a91fd
commit f7fc8422f7
7 changed files with 18 additions and 2 deletions

View File

@ -117,6 +117,7 @@ testRun(void)
String *controlFile = strNew("db/" PG_PATH_GLOBAL "/" PG_FILE_PGCONTROL);
PgControlFile control = {.systemId = 0xFACEFACE, .controlVersion = 1002, .catalogVersion = 201707211};
Buffer *controlBuffer = bufNew(512);
memset(bufPtr(controlBuffer), 0, bufSize(controlBuffer));
memcpy(bufPtr(controlBuffer), &control, sizeof(PgControlFile));
bufUsedSet(controlBuffer, bufSize(controlBuffer));
storagePutNP(storageNewWriteNP(storageTest, controlFile), controlBuffer);