2017-09-30 16:44:03 +02:00
|
|
|
####################################################################################################################################
|
|
|
|
# Sanity Tests for C Library
|
|
|
|
#
|
2017-10-12 18:55:48 +02:00
|
|
|
# Test to ensure the C library loads and is compiled correctly. Unit and integration tests are performed by test/test.pl.
|
2017-09-30 16:44:03 +02:00
|
|
|
####################################################################################################################################
|
|
|
|
use strict;
|
|
|
|
use warnings;
|
|
|
|
use Carp;
|
|
|
|
use English '-no_match_vars';
|
|
|
|
|
|
|
|
# Set number of tests
|
2017-11-02 14:14:13 +02:00
|
|
|
use Test::More tests => 4;
|
2017-09-30 16:44:03 +02:00
|
|
|
|
|
|
|
# Make sure the module loads without errors
|
2017-11-02 14:14:13 +02:00
|
|
|
BEGIN {use_ok('pgBackRest::LibC', qw(:debug :config :configDefine))};
|
2017-09-30 16:44:03 +02:00
|
|
|
|
|
|
|
# UVSIZE determines the pointer and long long int size. This needs to be 8 to indicate 64-bit types are available.
|
|
|
|
ok (&UVSIZE == 8, 'UVSIZE == 8');
|
2017-11-02 14:14:13 +02:00
|
|
|
|
|
|
|
# Check constant that is created dynamically
|
|
|
|
ok (CFGOPTVAL_BACKUP_TYPE_FULL eq 'full', 'auto constant valid');
|
|
|
|
|
|
|
|
# Check constant that is exported from C
|
|
|
|
ok (CFGDEF_TYPE_HASH >= 0, 'auto constant valid');
|