1
0
mirror of https://github.com/pgbackrest/pgbackrest.git synced 2025-06-18 23:57:33 +02:00

Improvements to page checksum module and tests:

* Page checksum module uses new C error handler.
* Convert page checksum tests into C unit tests.
This commit is contained in:
David Steele
2017-10-16 11:03:06 -04:00
parent 80758f0023
commit 9d78948a14
8 changed files with 159 additions and 147 deletions

View File

@ -62,12 +62,10 @@ calculate a subset of the columns at a time and perform multiple passes to avoid
is not used. Current coding also assumes that the compiler has the ability to unroll the inner loop to avoid loop overhead and
minimize register spilling. For less sophisticated compilers it might be beneficial to manually unroll the inner loop.
***********************************************************************************************************************************/
#include "EXTERN.h"
#include "perl.h"
#include <string.h>
#include "common/type.h"
#include "common/error.h"
#include "postgres/pageChecksum.h"
/***********************************************************************************************************************************
For historical reasons, the 64-bit LSN value is stored as two 32-bit values.
@ -211,9 +209,7 @@ pageChecksumBufferTest(
{
// If the buffer does not represent an even number of pages then error
if (pageBufferSize % pageSize != 0 || pageBufferSize / pageSize == 0)
{
croak("buffer size %lu, page size %lu are not divisible", pageBufferSize, pageSize);
}
ERROR_THROW(AssertError, "buffer size %lu, page size %lu are not divisible", pageBufferSize, pageSize);
// Loop through all pages in the buffer
for (int pageIdx = 0; pageIdx < pageBufferSize / pageSize; pageIdx++)