Browse Source

Applied updates and worked on tests

master
Joachim Metz 1 year ago
parent
commit
f3a2f8e124
No known key found for this signature in database GPG Key ID: D9625E5D7AD0177E
31 changed files with 1745 additions and 118 deletions
  1. +13
    -4
      .travis.yml
  2. +1
    -1
      configure.ac
  3. +49
    -21
      libpff/libpff_deflate.c
  4. +14
    -8
      libpff/libpff_deflate.h
  5. +4
    -3
      m4/libbfio.m4
  6. +4
    -3
      m4/libcdata.m4
  7. +4
    -3
      m4/libcerror.m4
  8. +4
    -3
      m4/libcfile.m4
  9. +4
    -3
      m4/libclocale.m4
  10. +4
    -3
      m4/libcnotify.m4
  11. +4
    -3
      m4/libcpath.m4
  12. +4
    -3
      m4/libcsplit.m4
  13. +4
    -3
      m4/libcthreads.m4
  14. +4
    -3
      m4/libfcache.m4
  15. +4
    -3
      m4/libfdata.m4
  16. +4
    -3
      m4/libfdatetime.m4
  17. +4
    -3
      m4/libfguid.m4
  18. +4
    -3
      m4/libfmapi.m4
  19. +4
    -3
      m4/libfvalue.m4
  20. +4
    -3
      m4/libfwnt.m4
  21. +4
    -3
      m4/libuna.m4
  22. +14
    -12
      m4/python.m4
  23. +7
    -5
      m4/zlib.m4
  24. +2
    -2
      manuals/pffexport.1
  25. +2
    -2
      manuals/pffinfo.1
  26. +0
    -1
      tests/Makefile.am
  27. +1551
    -7
      tests/pff_test_deflate.c
  28. +7
    -0
      tests/pff_test_macros.h
  29. +1
    -1
      tests/test_library.ps1
  30. +1
    -1
      tests/test_library.sh
  31. +15
    -2
      tests/test_manpage.sh

+ 13
- 4
.travis.yml View File

@@ -189,7 +189,7 @@ matrix:
compiler: gcc
os: osx
osx_image: xcode8.3
- name: "Mac OS gcc and pkgbuild"
- name: "Mac OS gcc and Python module and pkgbuild"
env:
- CONFIGURE_OPTIONS="--disable-dependency-tracking --prefix=/usr/local --enable-python --with-pyprefix"
- TARGET="macos-gcc-pkgbuild"
@@ -223,9 +223,18 @@ script:
- if test ${TARGET} = "linux-gcc-python-setup-py" || test ${TARGET} = "macos-gcc-python-setup-py"; then
./configure ${CONFIGURE_OPTIONS} && make > /dev/null && python ./setup.py build;
elif test ${TARGET} != "coverity"; then
./configure ${CONFIGURE_OPTIONS} && make > /dev/null && make check CHECK_WITH_STDERR=1;
if test $? -ne 0 && test -f tests/test-suite.log; then
cat tests/test-suite.log;
./configure ${CONFIGURE_OPTIONS} && make > /dev/null; RESULT=$?;
if test ${RESULT} -eq 0; then
if test ${TARGET} = "macos-gcc-python" || test ${TARGET} = "macos-gcc-pkgbuild"; then
install_name_tool -change /usr/local/lib/libpff.1.dylib ${PWD}/libpff/.libs/libpff.1.dylib ./pypff/.libs/pypff.so;
fi;
make check CHECK_WITH_STDERR=1; RESULT=$?;
fi;
if test ${RESULT} -ne 0; then
if test -f tests/test-suite.log; then
cat tests/test-suite.log;
fi;
return ${RESULT};
fi;
if test ${TARGET} = "macos-gcc-pkgbuild"; then
VERSION=`sed '5!d; s/^ \[//;s/\],$//' configure.ac` &&


+ 1
- 1
configure.ac View File

@@ -2,7 +2,7 @@ AC_PREREQ( 2.59 )

AC_INIT(
[libpff],
[20190228],
[20190316],
[joachim.metz@gmail.com])

AC_CONFIG_SRCDIR(


+ 49
- 21
libpff/libpff_deflate.c View File

@@ -36,7 +36,8 @@ int libpff_deflate_bit_stream_get_value(
uint32_t *value_32bit,
libcerror_error_t **error )
{
static char *function = "libpff_deflate_bit_stream_get_value";
static char *function = "libpff_deflate_bit_stream_get_value";
uint32_t safe_value_32bit = 0;

if( bit_stream == NULL )
{
@@ -90,16 +91,29 @@ int libpff_deflate_bit_stream_get_value(

return( -1 );
}
*value_32bit = bit_stream->byte_stream[ bit_stream->byte_stream_offset++ ];
*value_32bit <<= bit_stream->bit_buffer_size;
safe_value_32bit = bit_stream->byte_stream[ bit_stream->byte_stream_offset++ ];
safe_value_32bit <<= bit_stream->bit_buffer_size;

bit_stream->bit_buffer |= *value_32bit;
bit_stream->bit_buffer |= safe_value_32bit;
bit_stream->bit_buffer_size += 8;
}
*value_32bit = bit_stream->bit_buffer & ~( 0xffffffffUL << number_of_bits );
safe_value_32bit = bit_stream->bit_buffer;

bit_stream->bit_buffer >>= number_of_bits;
bit_stream->bit_buffer_size -= number_of_bits;
if( number_of_bits < 32 )
{
/* On VS 2008 32-bit "~( 0xfffffffUL << 32 )" does not behave as expected
*/
safe_value_32bit &= ~( 0xffffffffUL << number_of_bits );

bit_stream->bit_buffer >>= number_of_bits;
bit_stream->bit_buffer_size -= number_of_bits;
}
else
{
bit_stream->bit_buffer = 0;
bit_stream->bit_buffer_size = 0;
}
*value_32bit = safe_value_32bit;

return( 1 );
}
@@ -315,15 +329,16 @@ int libpff_deflate_bit_stream_get_huffman_encoded_value(
uint32_t *value_32bit,
libcerror_error_t **error )
{
static char *function = "libpff_deflate_bit_stream_get_huffman_encoded_value";
uint32_t bit_buffer = 0;
uint8_t bit_index = 0;
uint8_t number_of_bits = 0;
int code_size_count = 0;
int first_huffman_code = 0;
int first_index = 0;
int huffman_code = 0;
int result = 0;
static char *function = "libpff_deflate_bit_stream_get_huffman_encoded_value";
uint32_t bit_buffer = 0;
uint32_t safe_value_32bit = 0;
uint8_t bit_index = 0;
uint8_t number_of_bits = 0;
int code_size_count = 0;
int first_huffman_code = 0;
int first_index = 0;
int huffman_code = 0;
int result = 0;

if( bit_stream == NULL )
{
@@ -366,10 +381,10 @@ int libpff_deflate_bit_stream_get_huffman_encoded_value(
{
break;
}
*value_32bit = bit_stream->byte_stream[ bit_stream->byte_stream_offset++ ];
*value_32bit <<= bit_stream->bit_buffer_size;
safe_value_32bit = bit_stream->byte_stream[ bit_stream->byte_stream_offset++ ];
safe_value_32bit <<= bit_stream->bit_buffer_size;

bit_stream->bit_buffer |= *value_32bit;
bit_stream->bit_buffer |= safe_value_32bit;
bit_stream->bit_buffer_size += 8;
}
if( table->maximum_number_of_bits < bit_stream->bit_buffer_size )
@@ -394,7 +409,7 @@ int libpff_deflate_bit_stream_get_huffman_encoded_value(

if( ( huffman_code - code_size_count ) < first_huffman_code )
{
*value_32bit = table->codes_array[ first_index + ( huffman_code - first_huffman_code ) ];
safe_value_32bit = table->codes_array[ first_index + ( huffman_code - first_huffman_code ) ];

result = 1;

@@ -409,7 +424,20 @@ int libpff_deflate_bit_stream_get_huffman_encoded_value(
bit_stream->bit_buffer >>= bit_index;
bit_stream->bit_buffer_size -= bit_index;
}
return( result );
if( result != 1 )
{
libcerror_error_set(
error,
LIBCERROR_ERROR_DOMAIN_RUNTIME,
LIBCERROR_RUNTIME_ERROR_VALUE_OUT_OF_BOUNDS,
"%s: invalid huffman encoded value.",
function );

return( -1 );
}
*value_32bit = safe_value_32bit;

return( 1 );
}

/* Initializes the dynamic Huffman tables


+ 14
- 8
libpff/libpff_deflate.h View File

@@ -106,18 +106,24 @@ int libpff_deflate_bit_stream_get_huffman_encoded_value(
uint32_t *value_32bit,
libcerror_error_t **error );

int libpff_deflate_bit_stream_get_huffman_encoded_value(
int libpff_deflate_initialize_dynamic_huffman_tables(
libpff_deflate_bit_stream_t *bit_stream,
libpff_deflate_huffman_table_t *table,
uint32_t *value_32bit,
libpff_deflate_huffman_table_t *literals_table,
libpff_deflate_huffman_table_t *distances_table,
libcerror_error_t **error );

int libpff_deflate_bit_stream_get_huffman_encoded_codes_array(
int libpff_deflate_initialize_fixed_huffman_tables(
libpff_deflate_huffman_table_t *literals_table,
libpff_deflate_huffman_table_t *distances_table,
libcerror_error_t **error );

int libpff_deflate_decode_huffman(
libpff_deflate_bit_stream_t *bit_stream,
libpff_deflate_huffman_table_t *code_size_table,
uint16_t *codes_array,
uint32_t maximum_number_of_codes,
uint32_t number_of_codes,
libpff_deflate_huffman_table_t *literals_table,
libpff_deflate_huffman_table_t *distances_table,
uint8_t *uncompressed_data,
size_t uncompressed_data_size,
size_t *uncompressed_data_offset,
libcerror_error_t **error );

int libpff_deflate_calculate_adler32(


+ 4
- 3
m4/libbfio.m4 View File

@@ -1,6 +1,6 @@
dnl Checks for libbfio required headers and functions
dnl
dnl Version: 20181117
dnl Version: 20190308

dnl Function to detect if libbfio is available
dnl ac_libbfio_dummy is used to prevent AC_CHECK_LIB adding unnecessary -l<library> arguments
@@ -8,7 +8,8 @@ AC_DEFUN([AX_LIBBFIO_CHECK_LIB],
[AS_IF(
[test "x$ac_cv_enable_shared_libs" = xno || test "x$ac_cv_with_libbfio" = xno],
[ac_cv_libbfio=no],
[dnl Check if the directory provided as parameter exists
[ac_cv_libbfio=check
dnl Check if the directory provided as parameter exists
AS_IF(
[test "x$ac_cv_with_libbfio" != x && test "x$ac_cv_with_libbfio" != xauto-detect],
[AS_IF(
@@ -19,7 +20,7 @@ AC_DEFUN([AX_LIBBFIO_CHECK_LIB],
[no such directory: $ac_cv_with_libbfio],
[1])
])
ac_cv_libbfio=check],
],
[dnl Check for a pkg-config file
AS_IF(
[test "x$cross_compiling" != "xyes" && test "x$PKGCONFIG" != "x"],


+ 4
- 3
m4/libcdata.m4 View File

@@ -1,6 +1,6 @@
dnl Checks for libcdata required headers and functions
dnl
dnl Version: 20190112
dnl Version: 20190308

dnl Function to detect if libcdata is available
dnl ac_libcdata_dummy is used to prevent AC_CHECK_LIB adding unnecessary -l<library> arguments
@@ -8,7 +8,8 @@ AC_DEFUN([AX_LIBCDATA_CHECK_LIB],
[AS_IF(
[test "x$ac_cv_enable_shared_libs" = xno || test "x$ac_cv_with_libcdata" = xno],
[ac_cv_libcdata=no],
[dnl Check if the directory provided as parameter exists
[ac_cv_libcdata=check
dnl Check if the directory provided as parameter exists
AS_IF(
[test "x$ac_cv_with_libcdata" != x && test "x$ac_cv_with_libcdata" != xauto-detect],
[AS_IF(
@@ -19,7 +20,7 @@ AC_DEFUN([AX_LIBCDATA_CHECK_LIB],
[no such directory: $ac_cv_with_libcdata],
[1])
])
ac_cv_libcdata=check],
],
[dnl Check for a pkg-config file
AS_IF(
[test "x$cross_compiling" != "xyes" && test "x$PKGCONFIG" != "x"],


+ 4
- 3
m4/libcerror.m4 View File

@@ -1,6 +1,6 @@
dnl Checks for libcerror required headers and functions
dnl
dnl Version: 20181117
dnl Version: 20190308

dnl Function to detect if libcerror is available
dnl ac_libcerror_dummy is used to prevent AC_CHECK_LIB adding unnecessary -l<library> arguments
@@ -8,7 +8,8 @@ AC_DEFUN([AX_LIBCERROR_CHECK_LIB],
[AS_IF(
[test "x$ac_cv_enable_shared_libs" = xno || test "x$ac_cv_with_libcerror" = xno],
[ac_cv_libcerror=no],
[dnl Check if the directory provided as parameter exists
[ac_cv_libcerror=check
dnl Check if the directory provided as parameter exists
AS_IF(
[test "x$ac_cv_with_libcerror" != x && test "x$ac_cv_with_libcerror" != xauto-detect],
[AS_IF(
@@ -19,7 +20,7 @@ AC_DEFUN([AX_LIBCERROR_CHECK_LIB],
[no such directory: $ac_cv_with_libcerror],
[1])
])
ac_cv_libcerror=check],
],
[dnl Check for a pkg-config file
AS_IF(
[test "x$cross_compiling" != "xyes" && test "x$PKGCONFIG" != "x"],


+ 4
- 3
m4/libcfile.m4 View File

@@ -1,6 +1,6 @@
dnl Checks for libcfile required headers and functions
dnl
dnl Version: 20181117
dnl Version: 20190308

dnl Function to detect if libcfile is available
dnl ac_libcfile_dummy is used to prevent AC_CHECK_LIB adding unnecessary -l<library> arguments
@@ -8,7 +8,8 @@ AC_DEFUN([AX_LIBCFILE_CHECK_LIB],
[AS_IF(
[test "x$ac_cv_enable_shared_libs" = xno || test "x$ac_cv_with_libcfile" = xno],
[ac_cv_libcfile=no],
[dnl Check if the directory provided as parameter exists
[ac_cv_libcfile=check
dnl Check if the directory provided as parameter exists
AS_IF(
[test "x$ac_cv_with_libcfile" != x && test "x$ac_cv_with_libcfile" != xauto-detect],
[AS_IF(
@@ -19,7 +20,7 @@ AC_DEFUN([AX_LIBCFILE_CHECK_LIB],
[no such directory: $ac_cv_with_libcfile],
[1])
])
ac_cv_libcfile=check],
],
[dnl Check for a pkg-config file
AS_IF(
[test "x$cross_compiling" != "xyes" && test "x$PKGCONFIG" != "x"],


+ 4
- 3
m4/libclocale.m4 View File

@@ -1,6 +1,6 @@
dnl Checks for libclocale required headers and functions
dnl
dnl Version: 20181117
dnl Version: 20190308

dnl Function to detect if libclocale is available
dnl ac_libclocale_dummy is used to prevent AC_CHECK_LIB adding unnecessary -l<library> arguments
@@ -8,7 +8,8 @@ AC_DEFUN([AX_LIBCLOCALE_CHECK_LIB],
[AS_IF(
[test "x$ac_cv_enable_shared_libs" = xno || test "x$ac_cv_with_libclocale" = xno],
[ac_cv_libclocale=no],
[dnl Check if the directory provided as parameter exists
[ac_cv_libclocale=check
dnl Check if the directory provided as parameter exists
AS_IF(
[test "x$ac_cv_with_libclocale" != x && test "x$ac_cv_with_libclocale" != xauto-detect],
[AS_IF(
@@ -19,7 +20,7 @@ AC_DEFUN([AX_LIBCLOCALE_CHECK_LIB],
[no such directory: $ac_cv_with_libclocale],
[1])
])
ac_cv_libclocale=check],
],
[dnl Check for a pkg-config file
AS_IF(
[test "x$cross_compiling" != "xyes" && test "x$PKGCONFIG" != "x"],


+ 4
- 3
m4/libcnotify.m4 View File

@@ -1,6 +1,6 @@
dnl Checks for libcnotify required headers and functions
dnl
dnl Version: 20181117
dnl Version: 20190308

dnl Function to detect if libcnotify is available
dnl ac_libcnotify_dummy is used to prevent AC_CHECK_LIB adding unnecessary -l<library> arguments
@@ -8,7 +8,8 @@ AC_DEFUN([AX_LIBCNOTIFY_CHECK_LIB],
[AS_IF(
[test "x$ac_cv_enable_shared_libs" = xno || test "x$ac_cv_with_libcnotify" = xno],
[ac_cv_libcnotify=no],
[dnl Check if the directory provided as parameter exists
[ac_cv_libcnotify=check
dnl Check if the directory provided as parameter exists
AS_IF(
[test "x$ac_cv_with_libcnotify" != x && test "x$ac_cv_with_libcnotify" != xauto-detect],
[AS_IF(
@@ -19,7 +20,7 @@ AC_DEFUN([AX_LIBCNOTIFY_CHECK_LIB],
[no such directory: $ac_cv_with_libcnotify],
[1])
])
ac_cv_libcnotify=check],
],
[dnl Check for a pkg-config file
AS_IF(
[test "x$cross_compiling" != "xyes" && test "x$PKGCONFIG" != "x"],


+ 4
- 3
m4/libcpath.m4 View File

@@ -1,6 +1,6 @@
dnl Checks for libcpath required headers and functions
dnl
dnl Version: 20181117
dnl Version: 20190308

dnl Function to detect if libcpath is available
dnl ac_libcpath_dummy is used to prevent AC_CHECK_LIB adding unnecessary -l<library> arguments
@@ -8,7 +8,8 @@ AC_DEFUN([AX_LIBCPATH_CHECK_LIB],
[AS_IF(
[test "x$ac_cv_enable_shared_libs" = xno || test "x$ac_cv_with_libcpath" = xno],
[ac_cv_libcpath=no],
[dnl Check if the directory provided as parameter exists
[ac_cv_libcpath=check
dnl Check if the directory provided as parameter exists
AS_IF(
[test "x$ac_cv_with_libcpath" != x && test "x$ac_cv_with_libcpath" != xauto-detect],
[AS_IF(
@@ -19,7 +20,7 @@ AC_DEFUN([AX_LIBCPATH_CHECK_LIB],
[no such directory: $ac_cv_with_libcpath],
[1])
])
ac_cv_libcpath=check],
],
[dnl Check for a pkg-config file
AS_IF(
[test "x$cross_compiling" != "xyes" && test "x$PKGCONFIG" != "x"],


+ 4
- 3
m4/libcsplit.m4 View File

@@ -1,6 +1,6 @@
dnl Checks for libcsplit required headers and functions
dnl
dnl Version: 20181117
dnl Version: 20190308

dnl Function to detect if libcsplit is available
dnl ac_libcsplit_dummy is used to prevent AC_CHECK_LIB adding unnecessary -l<library> arguments
@@ -8,7 +8,8 @@ AC_DEFUN([AX_LIBCSPLIT_CHECK_LIB],
[AS_IF(
[test "x$ac_cv_enable_shared_libs" = xno || test "x$ac_cv_with_libcsplit" = xno],
[ac_cv_libcsplit=no],
[dnl Check if the directory provided as parameter exists
[ac_cv_libcsplit=check
dnl Check if the directory provided as parameter exists
AS_IF(
[test "x$ac_cv_with_libcsplit" != x && test "x$ac_cv_with_libcsplit" != xauto-detect],
[AS_IF(
@@ -19,7 +20,7 @@ AC_DEFUN([AX_LIBCSPLIT_CHECK_LIB],
[no such directory: $ac_cv_with_libcsplit],
[1])
])
ac_cv_libcsplit=check],
],
[dnl Check for a pkg-config file
AS_IF(
[test "x$cross_compiling" != "xyes" && test "x$PKGCONFIG" != "x"],


+ 4
- 3
m4/libcthreads.m4 View File

@@ -1,6 +1,6 @@
dnl Checks for libcthreads required headers and functions
dnl
dnl Version: 20181117
dnl Version: 20190308

dnl Function to detect if libcthreads is available
dnl ac_libcthreads_dummy is used to prevent AC_CHECK_LIB adding unnecessary -l<library> arguments
@@ -8,7 +8,8 @@ AC_DEFUN([AX_LIBCTHREADS_CHECK_LIB],
[AS_IF(
[test "x$ac_cv_enable_shared_libs" = xno || test "x$ac_cv_with_libcthreads" = xno],
[ac_cv_libcthreads=no],
[dnl Check if the directory provided as parameter exists
[ac_cv_libcthreads=check
dnl Check if the directory provided as parameter exists
AS_IF(
[test "x$ac_cv_with_libcthreads" != x && test "x$ac_cv_with_libcthreads" != xauto-detect],
[AS_IF(
@@ -19,7 +20,7 @@ AC_DEFUN([AX_LIBCTHREADS_CHECK_LIB],
[no such directory: $ac_cv_with_libcthreads],
[1])
])
ac_cv_libcthreads=check],
],
[dnl Check for a pkg-config file
AS_IF(
[test "x$cross_compiling" != "xyes" && test "x$PKGCONFIG" != "x"],


+ 4
- 3
m4/libfcache.m4 View File

@@ -1,6 +1,6 @@
dnl Checks for libfcache required headers and functions
dnl
dnl Version: 20181117
dnl Version: 20190308

dnl Function to detect if libfcache is available
dnl ac_libfcache_dummy is used to prevent AC_CHECK_LIB adding unnecessary -l<library> arguments
@@ -8,7 +8,8 @@ AC_DEFUN([AX_LIBFCACHE_CHECK_LIB],
[AS_IF(
[test "x$ac_cv_enable_shared_libs" = xno || test "x$ac_cv_with_libfcache" = xno],
[ac_cv_libfcache=no],
[dnl Check if the directory provided as parameter exists
[ac_cv_libfcache=check
dnl Check if the directory provided as parameter exists
AS_IF(
[test "x$ac_cv_with_libfcache" != x && test "x$ac_cv_with_libfcache" != xauto-detect],
[AS_IF(
@@ -19,7 +20,7 @@ AC_DEFUN([AX_LIBFCACHE_CHECK_LIB],
[no such directory: $ac_cv_with_libfcache],
[1])
])
ac_cv_libfcache=check],
],
[dnl Check for a pkg-config file
AS_IF(
[test "x$cross_compiling" != "xyes" && test "x$PKGCONFIG" != "x"],


+ 4
- 3
m4/libfdata.m4 View File

@@ -1,6 +1,6 @@
dnl Functions for libfdata
dnl
dnl Version: 20181117
dnl Version: 20190308

dnl Function to detect if libfdata is available
dnl ac_libfdata_dummy is used to prevent AC_CHECK_LIB adding unnecessary -l<library> arguments
@@ -8,7 +8,8 @@ AC_DEFUN([AX_LIBFDATA_CHECK_LIB],
[AS_IF(
[test "x$ac_cv_enable_shared_libs" = xno || test "x$ac_cv_with_libfdata" = xno],
[ac_cv_libfdata=no],
[dnl Check if the directory provided as parameter exists
[ac_cv_libfdata=check
dnl Check if the directory provided as parameter exists
AS_IF(
[test "x$ac_cv_with_libfdata" != x && test "x$ac_cv_with_libfdata" != xauto-detect],
[AS_IF(
@@ -19,7 +20,7 @@ AC_DEFUN([AX_LIBFDATA_CHECK_LIB],
[no such directory: $ac_cv_with_libfdata],
[1])
])
ac_cv_libfdata=check],
],
[dnl Check for a pkg-config file
AS_IF(
[test "x$cross_compiling" != "xyes" && test "x$PKGCONFIG" != "x"],


+ 4
- 3
m4/libfdatetime.m4 View File

@@ -1,6 +1,6 @@
dnl Checks for libfdatetime required headers and functions
dnl
dnl Version: 20181117
dnl Version: 20190308

dnl Function to detect if libfdatetime is available
dnl ac_libfdatetime_dummy is used to prevent AC_CHECK_LIB adding unnecessary -l<library> arguments
@@ -8,7 +8,8 @@ AC_DEFUN([AX_LIBFDATETIME_CHECK_LIB],
[AS_IF(
[test "x$ac_cv_enable_shared_libs" = xno || test "x$ac_cv_with_libfdatetime" = xno],
[ac_cv_libfdatetime=no],
[dnl Check if the directory provided as parameter exists
[ac_cv_libfdatetime=check
dnl Check if the directory provided as parameter exists
AS_IF(
[test "x$ac_cv_with_libfdatetime" != x && test "x$ac_cv_with_libfdatetime" != xauto-detect],
[AS_IF(
@@ -19,7 +20,7 @@ AC_DEFUN([AX_LIBFDATETIME_CHECK_LIB],
[no such directory: $ac_cv_with_libfdatetime],
[1])
])
ac_cv_libfdatetime=check],
],
[dnl Check for a pkg-config file
AS_IF(
[test "x$cross_compiling" != "xyes" && test "x$PKGCONFIG" != "x"],


+ 4
- 3
m4/libfguid.m4 View File

@@ -1,6 +1,6 @@
dnl Checks for libfguid required headers and functions
dnl
dnl Version: 20181117
dnl Version: 20190308

dnl Function to detect if libfguid is available
dnl ac_libfguid_dummy is used to prevent AC_CHECK_LIB adding unnecessary -l<library> arguments
@@ -8,7 +8,8 @@ AC_DEFUN([AX_LIBFGUID_CHECK_LIB],
[AS_IF(
[test "x$ac_cv_enable_shared_libs" = xno || test "x$ac_cv_with_libfguid" = xno],
[ac_cv_libfguid=no],
[dnl Check if the directory provided as parameter exists
[ac_cv_libfguid=check
dnl Check if the directory provided as parameter exists
AS_IF(
[test "x$ac_cv_with_libfguid" != x && test "x$ac_cv_with_libfguid" != xauto-detect],
[AS_IF(
@@ -19,7 +20,7 @@ AC_DEFUN([AX_LIBFGUID_CHECK_LIB],
[no such directory: $ac_cv_with_libfguid],
[1])
])
ac_cv_libfguid=check],
],
[dnl Check for a pkg-config file
AS_IF(
[test "x$cross_compiling" != "xyes" && test "x$PKGCONFIG" != "x"],


+ 4
- 3
m4/libfmapi.m4 View File

@@ -1,6 +1,6 @@
dnl Checks for libfmapi required headers and functions
dnl
dnl Version: 20181117
dnl Version: 20190308

dnl Function to detect if libfmapi is available
dnl ac_libfmapi_dummy is used to prevent AC_CHECK_LIB adding unnecessary -l<library> arguments
@@ -8,7 +8,8 @@ AC_DEFUN([AX_LIBFMAPI_CHECK_LIB],
[AS_IF(
[test "x$ac_cv_enable_shared_libs" = xno || test "x$ac_cv_with_libfmapi" = xno],
[ac_cv_libfmapi=no],
[dnl Check if the directory provided as parameter exists
[ac_cv_libfmapi=check
dnl Check if the directory provided as parameter exists
AS_IF(
[test "x$ac_cv_with_libfmapi" != x && test "x$ac_cv_with_libfmapi" != xauto-detect],
[AS_IF(
@@ -19,7 +20,7 @@ AC_DEFUN([AX_LIBFMAPI_CHECK_LIB],
[no such directory: $ac_cv_with_libfmapi],
[1])
])
ac_cv_libfmapi=check],
],
[dnl Check for a pkg-config file
AS_IF(
[test "x$cross_compiling" != "xyes" && test "x$PKGCONFIG" != "x"],


+ 4
- 3
m4/libfvalue.m4 View File

@@ -1,6 +1,6 @@
dnl Checks for libfvalue required headers and functions
dnl
dnl Version: 20181117
dnl Version: 20190308

dnl Function to detect if libfvalue is available
dnl ac_libfvalue_dummy is used to prevent AC_CHECK_LIB adding unnecessary -l<library> arguments
@@ -8,7 +8,8 @@ AC_DEFUN([AX_LIBFVALUE_CHECK_LIB],
[AS_IF(
[test "x$ac_cv_enable_shared_libs" = xno || test "x$ac_cv_with_libfvalue" = xno],
[ac_cv_libfvalue=no],
[dnl Check if the directory provided as parameter exists
[ac_cv_libfvalue=check
dnl Check if the directory provided as parameter exists
AS_IF(
[test "x$ac_cv_with_libfvalue" != x && test "x$ac_cv_with_libfvalue" != xauto-detect],
[AS_IF(
@@ -19,7 +20,7 @@ AC_DEFUN([AX_LIBFVALUE_CHECK_LIB],
[no such directory: $ac_cv_with_libfvalue],
[1])
])
ac_cv_libfvalue=check],
],
[dnl Check for a pkg-config file
AS_IF(
[test "x$cross_compiling" != "xyes" && test "x$PKGCONFIG" != "x"],


+ 4
- 3
m4/libfwnt.m4 View File

@@ -1,6 +1,6 @@
dnl Checks for libfwnt required headers and functions
dnl
dnl Version: 20181117
dnl Version: 20190308

dnl Function to detect if libfwnt is available
dnl ac_libfwnt_dummy is used to prevent AC_CHECK_LIB adding unnecessary -l<library> arguments
@@ -8,7 +8,8 @@ AC_DEFUN([AX_LIBFWNT_CHECK_LIB],
[AS_IF(
[test "x$ac_cv_enable_shared_libs" = xno || test "x$ac_cv_with_libfwnt" = xno],
[ac_cv_libfwnt=no],
[dnl Check if the directory provided as parameter exists
[ac_cv_libfwnt=check
dnl Check if the directory provided as parameter exists
AS_IF(
[test "x$ac_cv_with_libfwnt" != x && test "x$ac_cv_with_libfwnt" != xauto-detect],
[AS_IF(
@@ -19,7 +20,7 @@ AC_DEFUN([AX_LIBFWNT_CHECK_LIB],
[no such directory: $ac_cv_with_libfwnt],
[1])
])
ac_cv_libfwnt=check],
],
[dnl Check for a pkg-config file
AS_IF(
[test "x$cross_compiling" != "xyes" && test "x$PKGCONFIG" != "x"],


+ 4
- 3
m4/libuna.m4 View File

@@ -1,6 +1,6 @@
dnl Checks for libuna or required headers and functions
dnl
dnl Version: 20181117
dnl Version: 20190308

dnl Function to detect if libuna is available
dnl ac_libuna_dummy is used to prevent AC_CHECK_LIB adding unnecessary -l<library> arguments
@@ -8,7 +8,8 @@ AC_DEFUN([AX_LIBUNA_CHECK_LIB],
[AS_IF(
[test "x$ac_cv_enable_shared_libs" = xno || test "x$ac_cv_with_libuna" = xno],
[ac_cv_libuna=no],
[dnl Check if the directory provided as parameter exists
[ac_cv_libuna=check
dnl Check if the directory provided as parameter exists
AS_IF(
[test "x$ac_cv_with_libuna" != x && test "x$ac_cv_with_libuna" != xauto-detect],
[AS_IF(
@@ -19,7 +20,7 @@ AC_DEFUN([AX_LIBUNA_CHECK_LIB],
[no such directory: $ac_cv_with_libuna],
[1])
])
ac_cv_libuna=check],
],
[dnl Check for a pkg-config file
AS_IF(
[test "x$cross_compiling" != "xyes" && test "x$PKGCONFIG" != "x"],


+ 14
- 12
m4/python.m4 View File

@@ -1,6 +1,6 @@
dnl Functions for Python bindings
dnl
dnl Version: 20170830
dnl Version: 20190316

dnl Function to check if the python binary is available
dnl "python${PYTHON_VERSION} python python# python#.#"
@@ -8,17 +8,13 @@ AC_DEFUN([AX_PROG_PYTHON],
[AS_IF(
[test "x${PYTHON_VERSION}" != x],
[ax_python_progs="python${PYTHON_VERSION}"],
[ax_python_progs="python python2 python2.7 python2.6 python2.5 python3 python3.7 python3.6 python3.5 python3.4 python3.3 python3.2 python3.1 python3.0"])
[ax_python_progs="python python2 python2.7 python2.6 python2.5 python3 python3.8 python3.7 python3.6 python3.5 python3.4 python3.3 python3.2 python3.1 python3.0"])
AC_CHECK_PROGS(
[PYTHON],
[$ax_python_progs])
AS_IF(
[test "x${PYTHON}" != x],
[ax_prog_python_version=`${PYTHON} -c "import sys; sys.stdout.write(sys.version[[:3]])" 2>/dev/null`;
AC_SUBST(
[PYTHON_VERSION],
[$ax_prog_python_version])

ax_prog_python_platform=`${PYTHON} -c "import sys; sys.stdout.write(sys.platform)" 2>/dev/null`;
AC_SUBST(
[PYTHON_PLATFORM],
@@ -62,7 +58,7 @@ AC_DEFUN([AX_PROG_PYTHON2],
dnl Function to check if the python3 binary is available
dnl "python3 python3.#"
AC_DEFUN([AX_PROG_PYTHON3],
[ax_python3_progs="python3 python3.4 python3.3 python3.2 python3.1 python3.0"
[ax_python3_progs="python3 python3.8 python3.7 python3.6 python3.5 python3.4 python3.3 python3.2 python3.1 python3.0"
AC_CHECK_PROGS(
[PYTHON3],
[$ax_python3_progs])
@@ -90,10 +86,16 @@ dnl Function to check if the python-config binary is available
dnl "python${PYTHON_VERSION}-config python-config"
AC_DEFUN([AX_PROG_PYTHON_CONFIG],
[AS_IF(
[test "x${PYTHON}" != x],
[test "x${PYTHON_CONFIG}" = x && test "x${PYTHON_VERSION}" != x],
[AC_CHECK_PROGS(
[PYTHON_CONFIG],
[python${PYTHON_VERSION}-config])
])
AS_IF(
[test "x${PYTHON_CONFIG}" = x],
[AC_CHECK_PROGS(
[PYTHON_CONFIG],
[python${PYTHON_VERSION}-config python-config])
[python-config])
])
AS_IF(
[test "x${PYTHON_CONFIG}" = x],
@@ -108,7 +110,7 @@ AC_DEFUN([AX_PROG_PYTHON_CONFIG],
dnl Function to check if the python2-config binary is available
AC_DEFUN([AX_PROG_PYTHON2_CONFIG],
[AS_IF(
[test "x${PYTHON2}" != x],
[test "x${PYTHON2_CONFIG}" = x],
[AC_CHECK_PROGS(
[PYTHON2_CONFIG],
[python2-config])
@@ -126,7 +128,7 @@ AC_DEFUN([AX_PROG_PYTHON2_CONFIG],
dnl Function to check if the python3-config binary is available
AC_DEFUN([AX_PROG_PYTHON3_CONFIG],
[AS_IF(
[test "x${PYTHON3}" != x],
[test "x${PYTHON3_CONFIG}" = x],
[AC_CHECK_PROGS(
[PYTHON3_CONFIG],
[python3-config])
@@ -185,7 +187,7 @@ AC_DEFUN([AX_PYTHON_CHECK],
AS_IF(
[test "x${ac_cv_header_python_h}" != xyes],
[ac_cv_enable_python=no],
[ac_cv_enable_python=$PYTHON_VERSION
[ac_cv_enable_python=${ax_prog_python_version}
AC_SUBST(
[PYTHON_CPPFLAGS],
[$PYTHON_INCLUDES])


+ 7
- 5
m4/zlib.m4 View File

@@ -1,13 +1,14 @@
dnl Checks for zlib required headers and functions
dnl
dnl Version: 20181117
dnl Version: 20190308

dnl Function to detect if zlib is available
AC_DEFUN([AX_ZLIB_CHECK_LIB],
[AS_IF(
[test "x$ac_cv_enable_shared_libs" = xno || test "x$ac_cv_with_zlib" = xno],
[ac_cv_zlib=no],
[dnl Check if the directory provided as parameter exists
[ac_cv_zlib=check
dnl Check if the directory provided as parameter exists
AS_IF(
[test "x$ac_cv_with_zlib" != x && test "x$ac_cv_with_zlib" != xauto-detect],
[AS_IF(
@@ -17,7 +18,8 @@ AC_DEFUN([AX_ZLIB_CHECK_LIB],
[AC_MSG_FAILURE(
[no such directory: $ac_cv_with_zlib],
[1])
])],
])
],
[dnl Check for a pkg-config file
AS_IF(
[test "x$cross_compiling" != "xyes" && test "x$PKGCONFIG" != "x"],
@@ -25,7 +27,7 @@ AC_DEFUN([AX_ZLIB_CHECK_LIB],
[zlib],
[zlib >= 1.2.5],
[ac_cv_zlib=zlib],
[ac_cv_zlib=no])
[ac_cv_zlib=check])
])
AS_IF(
[test "x$ac_cv_zlib" = xzlib],
@@ -34,7 +36,7 @@ AC_DEFUN([AX_ZLIB_CHECK_LIB],
])

AS_IF(
[test "x$ac_cv_zlib" = xno],
[test "x$ac_cv_zlib" = xcheck],
[dnl Check for headers
AC_CHECK_HEADERS([zlib.h])



+ 2
- 2
manuals/pffexport.1 View File

@@ -1,4 +1,4 @@
.Dd January 1, 2017
.Dd March 16, 2019
.Dt pffexport
.Os libpff
.Sh NAME
@@ -12,7 +12,7 @@
.Op Fl m Ar mode
.Op Fl t Ar target
.Op Fl dhqvV
.Va Ar source
.Ar source
.Sh DESCRIPTION
.Nm pffexport
is a utility to export items stored in a Personal Folder File (OST, PAB and PST)


+ 2
- 2
manuals/pffinfo.1 View File

@@ -1,4 +1,4 @@
.Dd January 1, 2017
.Dd March 16, 2019
.Dt pffinfo
.Os libpff
.Sh NAME
@@ -8,7 +8,7 @@
.Nm pffinfo
.Op Fl c Ar codepage
.Op Fl ahvV
.Va Ar source
.Ar source
.Sh DESCRIPTION
.Nm pffinfo
is a utility to determine information about a Personal Folder File (OST, PAB and PST)


+ 0
- 1
tests/Makefile.am View File

@@ -28,7 +28,6 @@ endif

TESTS = \
test_library.sh \
test_manpage.sh \
test_read_items.sh \
test_pffinfo.sh \
test_pffexport.sh \


+ 1551
- 7
tests/pff_test_deflate.c
File diff suppressed because it is too large
View File


+ 7
- 0
tests/pff_test_macros.h View File

@@ -99,6 +99,13 @@
goto on_error; \
}

#define PFF_TEST_ASSERT_NOT_EQUAL_SSIZE( name, value, expected_value ) \
if( value == expected_value ) \
{ \
fprintf( stdout, "%s:%d %s (%" PRIzd ") == %" PRIzd "\n", __FILE__, __LINE__, name, value, expected_value ); \
goto on_error; \
}

#define PFF_TEST_ASSERT_EQUAL_INT8( name, value, expected_value ) \
if( value != expected_value ) \
{ \


+ 1
- 1
tests/test_library.ps1 View File

@@ -6,7 +6,7 @@ $ExitSuccess = 0
$ExitFailure = 1
$ExitIgnore = 77

$LibraryTests = "allocation_table attached_file_io_handle column_definition data_array data_array_entry data_block descriptors_index error index index_node index_value io_handle item item_descriptor item_tree item_values local_descriptor_node local_descriptor_value local_descriptors multi_value name_to_id_map_entry notify offsets_index record_entry record_set reference_descriptor table table_block_index table_index_value value_type"
$LibraryTests = "allocation_table attached_file_io_handle column_definition data_array data_array_entry data_block deflate descriptors_index error index index_node index_value io_handle item item_descriptor item_tree item_values local_descriptor_node local_descriptor_value local_descriptors multi_value name_to_id_map_entry notify offsets_index record_entry record_set reference_descriptor table table_block_index table_index_value value_type"
$LibraryTestsWithInput = "file support"

$InputGlob = "*"


+ 1
- 1
tests/test_library.sh View File

@@ -7,7 +7,7 @@ EXIT_SUCCESS=0;
EXIT_FAILURE=1;
EXIT_IGNORE=77;

LIBRARY_TESTS="allocation_table attached_file_io_handle column_definition data_array data_array_entry data_block descriptors_index error index index_node index_value io_handle item item_descriptor item_tree item_values local_descriptor_node local_descriptor_value local_descriptors multi_value name_to_id_map_entry notify offsets_index record_entry record_set reference_descriptor table table_block_index table_index_value value_type";
LIBRARY_TESTS="allocation_table attached_file_io_handle column_definition data_array data_array_entry data_block deflate descriptors_index error index index_node index_value io_handle item item_descriptor item_tree item_values local_descriptor_node local_descriptor_value local_descriptors multi_value name_to_id_map_entry notify offsets_index record_entry record_set reference_descriptor table table_block_index table_index_value value_type";
LIBRARY_TESTS_WITH_INPUT="file support";
OPTION_SETS="";



+ 15
- 2
tests/test_manpage.sh View File

@@ -1,7 +1,7 @@
#!/bin/bash
# Tests man pages.
#
# Version: 20190224
# Version: 20190302

EXIT_SUCCESS=0;
EXIT_FAILURE=1;
@@ -18,12 +18,25 @@ run_test()
LC_ALL=en_US.UTF-8 MANROFFSEQ='' MANWIDTH=80 man --warnings -E UTF-8 -l -Tutf8 -Z ${INPUT_FILE} > /dev/null 2> ${TMPDIR}/${TEST_NAME}.warnings;
RESULT=$?;

if test ${RESULT} -ne ${EXIT_SUCCESS} || test -s ${TMPDIR}/${TEST_NAME}.warnings;
# For now line break warnings are ignored.
if test -f ${TMPDIR}/${TEST_NAME}.warnings;
then
sed "/can't break line/ d" -i ${TMPDIR}/${TEST_NAME}.warnings;
fi
if test -s ${TMPDIR}/${TEST_NAME}.warnings;
then
RESULT=${EXIT_FAILURE};
fi
if test ${RESULT} -ne ${EXIT_SUCCESS};
then
echo " (FAIL)";
else
echo " (PASS)";
fi
if test -s ${TMPDIR}/${TEST_NAME}.warnings;
then
cat ${TMPDIR}/${TEST_NAME}.warnings;
fi
return ${RESULT};
}



Loading…
Cancel
Save