Script 'mail_helper' called by obssrc Hello community, here is the log from the commit of package libfwps for openSUSE:Factory checked in at 2024-03-01 23:39:16 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/libfwps (Old) and /work/SRC/openSUSE:Factory/.libfwps.new.1770 (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "libfwps" Fri Mar 1 23:39:16 2024 rev:13 rq:1154051 version:20240301 Changes: -------- --- /work/SRC/openSUSE:Factory/libfwps/libfwps.changes 2024-02-26 19:45:45.630710557 +0100 +++ /work/SRC/openSUSE:Factory/.libfwps.new.1770/libfwps.changes 2024-03-01 23:39:17.421454119 +0100 @@ -1,0 +2,6 @@ +Fri Mar 1 12:48:01 UTC 2024 - Jan Engelhardt <jeng...@inai.de> + +- Update to release 20240301 + * doc: VARENUM type mentions for fields + +------------------------------------------------------------------- Old: ---- libfwps-alpha-20240225.tar.gz libfwps-alpha-20240225.tar.gz.asc New: ---- libfwps-alpha-20240301.tar.gz libfwps-alpha-20240301.tar.gz.asc ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ libfwps.spec ++++++ --- /var/tmp/diff_new_pack.nyfz1O/_old 2024-03-01 23:39:18.417490136 +0100 +++ /var/tmp/diff_new_pack.nyfz1O/_new 2024-03-01 23:39:18.417490136 +0100 @@ -18,7 +18,7 @@ Name: libfwps %define lname libfwps1 -Version: 20240225 +Version: 20240301 Release: 0 Summary: Library for Windows Property Store data types License: LGPL-3.0-or-later ++++++ libfwps-alpha-20240225.tar.gz -> libfwps-alpha-20240301.tar.gz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libfwps-20240225/common/config.h new/libfwps-20240301/common/config.h --- old/libfwps-20240225/common/config.h 2024-02-25 18:20:22.000000000 +0100 +++ new/libfwps-20240301/common/config.h 2024-03-01 12:55:00.000000000 +0100 @@ -389,7 +389,7 @@ #define PACKAGE_NAME "libfwps" /* Define to the full name and version of this package. */ -#define PACKAGE_STRING "libfwps 20240225" +#define PACKAGE_STRING "libfwps 20240301" /* Define to the one symbol short name of this package. */ #define PACKAGE_TARNAME "libfwps" @@ -398,7 +398,7 @@ #define PACKAGE_URL "" /* Define to the version of this package. */ -#define PACKAGE_VERSION "20240225" +#define PACKAGE_VERSION "20240301" /* The size of `int', as computed by sizeof. */ #define SIZEOF_INT 4 @@ -424,7 +424,7 @@ /* #undef STRERROR_R_CHAR_P */ /* Version number of package */ -#define VERSION "20240225" +#define VERSION "20240301" /* Number of bits in a file offset, on hosts where this is settable. */ /* #undef _FILE_OFFSET_BITS */ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libfwps-20240225/configure new/libfwps-20240301/configure --- old/libfwps-20240225/configure 2024-02-25 18:20:09.000000000 +0100 +++ new/libfwps-20240301/configure 2024-03-01 12:54:44.000000000 +0100 @@ -1,6 +1,6 @@ #! /bin/sh # Guess values for system-dependent variables and create Makefiles. -# Generated by GNU Autoconf 2.71 for libfwps 20240225. +# Generated by GNU Autoconf 2.71 for libfwps 20240301. # # Report bugs to <joachim.m...@gmail.com>. # @@ -621,8 +621,8 @@ # Identity of this package. PACKAGE_NAME='libfwps' PACKAGE_TARNAME='libfwps' -PACKAGE_VERSION='20240225' -PACKAGE_STRING='libfwps 20240225' +PACKAGE_VERSION='20240301' +PACKAGE_STRING='libfwps 20240301' PACKAGE_BUGREPORT='joachim.m...@gmail.com' PACKAGE_URL='' @@ -1556,7 +1556,7 @@ # Omit some internal or obsolete options to make the list less imposing. # This message is too long to be a string in the A/UX 3.1 sh. cat <<_ACEOF -\`configure' configures libfwps 20240225 to adapt to many kinds of systems. +\`configure' configures libfwps 20240301 to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... @@ -1627,7 +1627,7 @@ if test -n "$ac_init_help"; then case $ac_init_help in - short | recursive ) echo "Configuration of libfwps 20240225:";; + short | recursive ) echo "Configuration of libfwps 20240301:";; esac cat <<\_ACEOF @@ -1826,7 +1826,7 @@ test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF -libfwps configure 20240225 +libfwps configure 20240301 generated by GNU Autoconf 2.71 Copyright (C) 2021 Free Software Foundation, Inc. @@ -2547,7 +2547,7 @@ This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. -It was created by libfwps $as_me 20240225, which was +It was created by libfwps $as_me 20240301, which was generated by GNU Autoconf 2.71. Invocation command line was $ $0$ac_configure_args_raw @@ -4036,7 +4036,7 @@ # Define the identity of the package. PACKAGE='libfwps' - VERSION='20240225' + VERSION='20240301' printf "%s\n" "#define PACKAGE \"$PACKAGE\"" >>confdefs.h @@ -44991,7 +44991,7 @@ # report actual input values of CONFIG_FILES etc. instead of their # values after options handling. ac_log=" -This file was extended by libfwps $as_me 20240225, which was +This file was extended by libfwps $as_me 20240301, which was generated by GNU Autoconf 2.71. Invocation command line was CONFIG_FILES = $CONFIG_FILES @@ -45059,7 +45059,7 @@ cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_cs_config='$ac_cs_config_escaped' ac_cs_version="\\ -libfwps config.status 20240225 +libfwps config.status 20240301 configured by $0, generated by GNU Autoconf 2.71, with options \\"\$ac_cs_config\\" diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libfwps-20240225/configure.ac new/libfwps-20240301/configure.ac --- old/libfwps-20240225/configure.ac 2024-02-25 16:11:25.000000000 +0100 +++ new/libfwps-20240301/configure.ac 2024-03-01 12:36:26.000000000 +0100 @@ -2,7 +2,7 @@ AC_INIT( [libfwps], - [20240225], + [20240301], [joachim.m...@gmail.com]) AC_CONFIG_SRCDIR( diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libfwps-20240225/dpkg/changelog new/libfwps-20240301/dpkg/changelog --- old/libfwps-20240225/dpkg/changelog 2024-02-25 18:20:22.000000000 +0100 +++ new/libfwps-20240301/dpkg/changelog 2024-03-01 12:55:00.000000000 +0100 @@ -1,5 +1,5 @@ -libfwps (20240225-1) unstable; urgency=low +libfwps (20240301-1) unstable; urgency=low * Auto-generated - -- Joachim Metz <joachim.m...@gmail.com> Sun, 25 Feb 2024 18:20:21 +0100 + -- Joachim Metz <joachim.m...@gmail.com> Fri, 01 Mar 2024 12:54:57 +0100 diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libfwps-20240225/include/libfwps/definitions.h new/libfwps-20240301/include/libfwps/definitions.h --- old/libfwps-20240225/include/libfwps/definitions.h 2024-02-25 18:20:22.000000000 +0100 +++ new/libfwps-20240301/include/libfwps/definitions.h 2024-03-01 12:55:00.000000000 +0100 @@ -24,11 +24,11 @@ #include <libfwps/types.h> -#define LIBFWPS_VERSION 20240225 +#define LIBFWPS_VERSION 20240301 /* The version string */ -#define LIBFWPS_VERSION_STRING "20240225" +#define LIBFWPS_VERSION_STRING "20240301" /* The byte order definitions */ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libfwps-20240225/libfwps/libfwps.rc new/libfwps-20240301/libfwps/libfwps.rc --- old/libfwps-20240225/libfwps/libfwps.rc 2024-02-25 18:20:22.000000000 +0100 +++ new/libfwps-20240301/libfwps/libfwps.rc 2024-03-01 12:55:00.000000000 +0100 @@ -22,12 +22,12 @@ BLOCK "040904E4" BEGIN VALUE "FileDescription", "Library to access the Windows Property Store format\0" - VALUE "FileVersion", "20240225" "\0" + VALUE "FileVersion", "20240301" "\0" VALUE "InternalName", "libfwps.dll\0" VALUE "LegalCopyright", "(C) 2013-2024, Joachim Metz <joachim.m...@gmail.com>\0" VALUE "OriginalFilename", "libfwps.dll\0" VALUE "ProductName", "libfwps\0" - VALUE "ProductVersion", "20240225" "\0" + VALUE "ProductVersion", "20240301" "\0" VALUE "Comments", "For more information visit https://github.com/libyal/libfwps/\0" END END diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libfwps-20240225/libfwps/libfwps_definitions.h new/libfwps-20240301/libfwps/libfwps_definitions.h --- old/libfwps-20240225/libfwps/libfwps_definitions.h 2024-02-25 18:20:22.000000000 +0100 +++ new/libfwps-20240301/libfwps/libfwps_definitions.h 2024-03-01 12:55:00.000000000 +0100 @@ -36,11 +36,11 @@ #else #include <byte_stream.h> -#define LIBFWPS_VERSION 20240225 +#define LIBFWPS_VERSION 20240301 /* The version string */ -#define LIBFWPS_VERSION_STRING "20240225" +#define LIBFWPS_VERSION_STRING "20240301" /* The byte order definitions */ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libfwps-20240225/libfwps/libfwps_libcnotify.h new/libfwps-20240301/libfwps/libfwps_libcnotify.h --- old/libfwps-20240225/libfwps/libfwps_libcnotify.h 2024-02-24 15:39:39.000000000 +0100 +++ new/libfwps-20240301/libfwps/libfwps_libcnotify.h 2024-03-01 12:36:29.000000000 +0100 @@ -1,5 +1,5 @@ /* - * The internal libcnotify header + * The libcnotify header wrapper * * Copyright (C) 2013-2024, Joachim Metz <joachim.m...@gmail.com> * @@ -44,7 +44,7 @@ #include <libcnotify.h> -#endif +#endif /* defined( HAVE_LOCAL_LIBCNOTIFY ) */ -#endif +#endif /* !defined( _LIBFWPS_LIBCNOTIFY_H ) */ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libfwps-20240225/libfwps/libfwps_record.c new/libfwps-20240301/libfwps/libfwps_record.c --- old/libfwps-20240225/libfwps/libfwps_record.c 2024-02-25 18:13:28.000000000 +0100 +++ new/libfwps-20240301/libfwps/libfwps_record.c 2024-03-01 12:36:29.000000000 +0100 @@ -659,7 +659,8 @@ if( has_variable_data_size == 0 ) { - if( number_of_values > ( (size_t) SSIZE_MAX / internal_record->value_data_size ) ) + if( ( internal_record->value_data_size > 0 ) + && ( number_of_values > ( (size_t) SSIZE_MAX / internal_record->value_data_size ) ) ) { libcerror_error_set( error, @@ -674,12 +675,13 @@ } else { - if( number_of_values == 0xffffffffUL ) + if( ( number_of_values > ( ( byte_stream_size - byte_stream_offset ) / 4 ) ) + || ( number_of_values == 0xffffffffUL ) ) { libcerror_error_set( error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_VALUE_OUT_OF_BOUNDS, + LIBCERROR_ERROR_DOMAIN_ARGUMENTS, + LIBCERROR_ARGUMENT_ERROR_VALUE_TOO_SMALL, "%s: invalid number of values value out of bounds.", function ); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libfwps-20240225/libfwps.spec new/libfwps-20240301/libfwps.spec --- old/libfwps-20240225/libfwps.spec 2024-02-25 18:20:22.000000000 +0100 +++ new/libfwps-20240301/libfwps.spec 2024-03-01 12:55:00.000000000 +0100 @@ -1,5 +1,5 @@ Name: libfwps -Version: 20240225 +Version: 20240301 Release: 1 Summary: Library to access the Windows Property Store format Group: System Environment/Libraries @@ -80,6 +80,6 @@ %{_libdir}/python3*/site-packages/*.so %changelog -* Sun Feb 25 2024 Joachim Metz <joachim.m...@gmail.com> 20240225-1 +* Fri Mar 1 2024 Joachim Metz <joachim.m...@gmail.com> 20240301-1 - Auto-generated diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libfwps-20240225/setup.cfg new/libfwps-20240301/setup.cfg --- old/libfwps-20240225/setup.cfg 2024-02-25 18:20:22.000000000 +0100 +++ new/libfwps-20240301/setup.cfg 2024-03-01 12:55:00.000000000 +0100 @@ -1,6 +1,6 @@ [metadata] name = libfwps-python -version = 20240225 +version = 20240301 description = Python bindings module for libfwps long_description = Python bindings module for libfwps long_description_content_type = text/plain diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libfwps-20240225/tests/Makefile.am new/libfwps-20240301/tests/Makefile.am --- old/libfwps-20240225/tests/Makefile.am 2024-02-25 16:16:29.000000000 +0100 +++ new/libfwps-20240301/tests/Makefile.am 2024-03-01 12:37:27.000000000 +0100 @@ -21,6 +21,7 @@ $(TESTS_PYFWPS) check_SCRIPTS = \ + pyfwps_test_record.py \ pyfwps_test_set.py \ pyfwps_test_store.py \ pyfwps_test_support.py \ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libfwps-20240225/tests/Makefile.in new/libfwps-20240301/tests/Makefile.in --- old/libfwps-20240225/tests/Makefile.in 2024-02-25 18:20:11.000000000 +0100 +++ new/libfwps-20240301/tests/Makefile.in 2024-03-01 12:54:46.000000000 +0100 @@ -700,6 +700,7 @@ $(TESTS_PYFWPS) check_SCRIPTS = \ + pyfwps_test_record.py \ pyfwps_test_set.py \ pyfwps_test_store.py \ pyfwps_test_support.py \ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libfwps-20240225/tests/pyfwps_test_record.py new/libfwps-20240301/tests/pyfwps_test_record.py --- old/libfwps-20240225/tests/pyfwps_test_record.py 1970-01-01 01:00:00.000000000 +0100 +++ new/libfwps-20240301/tests/pyfwps_test_record.py 2024-03-01 12:37:49.000000000 +0100 @@ -0,0 +1,183 @@ +#!/usr/bin/env python +# +# Python-bindings record type test script +# +# Copyright (C) 2013-2024, Joachim Metz <joachim.m...@gmail.com> +# +# Refer to AUTHORS for acknowledgements. +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU Lesser General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU Lesser General Public License +# along with this program. If not, see <https://www.gnu.org/licenses/>. + +import argparse +import os +import sys +import unittest + +import pyfwps + + +class RecordTypeTests(unittest.TestCase): + """Tests the record type.""" + + _TEST_DATA = bytes(bytearray([ + 0x89, 0x00, 0x00, 0x00, 0x31, 0x53, 0x50, 0x53, 0xe2, 0x8a, 0x58, 0x46, + 0xbc, 0x4c, 0x38, 0x43, 0xbb, 0xfc, 0x13, 0x93, 0x26, 0x98, 0x6d, 0xce, + 0x6d, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, 0x1f, 0x00, 0x00, + 0x00, 0x2e, 0x00, 0x00, 0x00, 0x53, 0x00, 0x2d, 0x00, 0x31, 0x00, 0x2d, + 0x00, 0x35, 0x00, 0x2d, 0x00, 0x32, 0x00, 0x31, 0x00, 0x2d, 0x00, 0x34, + 0x00, 0x30, 0x00, 0x36, 0x00, 0x30, 0x00, 0x32, 0x00, 0x38, 0x00, 0x39, + 0x00, 0x33, 0x00, 0x32, 0x00, 0x33, 0x00, 0x2d, 0x00, 0x31, 0x00, 0x39, + 0x00, 0x39, 0x00, 0x37, 0x00, 0x30, 0x00, 0x31, 0x00, 0x30, 0x00, 0x32, + 0x00, 0x32, 0x00, 0x2d, 0x00, 0x33, 0x00, 0x39, 0x00, 0x32, 0x00, 0x34, + 0x00, 0x38, 0x00, 0x30, 0x00, 0x31, 0x00, 0x36, 0x00, 0x38, 0x00, 0x31, + 0x00, 0x2d, 0x00, 0x31, 0x00, 0x30, 0x00, 0x30, 0x00, 0x30, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00])) + + def test_get_entry_name(self): + """Tests the get_entry_name function and entry_name property.""" + fwps_set = pyfwps.set() + + fwps_set.copy_from_byte_stream(self._TEST_DATA) + + fwps_record = fwps_set.get_record(0) + self.assertIsNotNone(fwps_record) + + entry_name = fwps_record.get_entry_name() + self.assertIsNone(entry_name) + + self.assertIsNone(fwps_record.entry_name) + + def test_get_entry_type(self): + """Tests the get_entry_type function and entry_type property.""" + fwps_set = pyfwps.set() + + fwps_set.copy_from_byte_stream(self._TEST_DATA) + + fwps_record = fwps_set.get_record(0) + self.assertIsNotNone(fwps_record) + + entry_type = fwps_record.get_entry_type() + self.assertEqual(entry_type, 4) + + self.assertEqual(fwps_record.entry_type, 4) + + def test_get_value_name(self): + """Tests the get_value_name function and value_name property.""" + fwps_set = pyfwps.set() + + fwps_set.copy_from_byte_stream(self._TEST_DATA) + + fwps_record = fwps_set.get_record(0) + self.assertIsNotNone(fwps_record) + + value_name = fwps_record.get_value_name() + self.assertIsNone(value_name) + + self.assertIsNone(fwps_record.value_name) + + def test_get_value_type(self): + """Tests the get_value_type function and value_type property.""" + fwps_set = pyfwps.set() + + fwps_set.copy_from_byte_stream(self._TEST_DATA) + + fwps_record = fwps_set.get_record(0) + self.assertIsNotNone(fwps_record) + + value_type = fwps_record.get_value_type() + self.assertEqual(value_type, 0x001f) + + self.assertEqual(fwps_record.value_type, 0x001f) + + def test_get_data(self): + """Tests the get_data function and data property.""" + fwps_set = pyfwps.set() + + fwps_set.copy_from_byte_stream(self._TEST_DATA) + + fwps_record = fwps_set.get_record(0) + self.assertIsNotNone(fwps_record) + + data = fwps_record.get_data() + self.assertIsNotNone(data) + + self.assertIsNotNone(fwps_record.data) + + def test_get_data_as_boolean(self): + """Tests the get_data_as_boolean function and data_as_boolean property.""" + fwps_set = pyfwps.set() + + fwps_set.copy_from_byte_stream(self._TEST_DATA) + + fwps_record = fwps_set.get_record(0) + self.assertIsNotNone(fwps_record) + + with self.assertRaises(IOError): + fwps_record.get_data_as_boolean() + + with self.assertRaises(IOError): + fwps_record.data_as_boolean + + def test_get_data_as_integer(self): + """Tests the get_data_as_integer function and data_as_integer property.""" + fwps_set = pyfwps.set() + + fwps_set.copy_from_byte_stream(self._TEST_DATA) + + fwps_record = fwps_set.get_record(0) + self.assertIsNotNone(fwps_record) + + with self.assertRaises(IOError): + fwps_record.get_data_as_integer() + + with self.assertRaises(IOError): + fwps_record.data_as_integer + + def test_get_data_as_floating_point(self): + """Tests the get_data_as_floating_point function and data_as_floating_point property.""" + fwps_set = pyfwps.set() + + fwps_set.copy_from_byte_stream(self._TEST_DATA) + + fwps_record = fwps_set.get_record(0) + self.assertIsNotNone(fwps_record) + + with self.assertRaises(IOError): + fwps_record.get_data_as_floating_point() + + with self.assertRaises(IOError): + fwps_record.data_as_floating_point + + def test_get_data_as_string(self): + """Tests the get_data_as_string function and data_as_string property.""" + fwps_set = pyfwps.set() + + fwps_set.copy_from_byte_stream(self._TEST_DATA) + + fwps_record = fwps_set.get_record(0) + self.assertIsNotNone(fwps_record) + + data_as_string = fwps_record.get_data_as_string() + self.assertIsNotNone(data_as_string) + + self.assertIsNotNone(fwps_record.data_as_string) + + +if __name__ == "__main__": + argument_parser = argparse.ArgumentParser() + + options, unknown_options = argument_parser.parse_known_args() + unknown_options.insert(0, sys.argv[0]) + + unittest.main(argv=unknown_options, verbosity=2) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libfwps-20240225/tests/pyfwps_test_set.py new/libfwps-20240301/tests/pyfwps_test_set.py --- old/libfwps-20240225/tests/pyfwps_test_set.py 2024-02-24 15:40:29.000000000 +0100 +++ new/libfwps-20240301/tests/pyfwps_test_set.py 2024-03-01 12:37:49.000000000 +0100 @@ -20,7 +20,6 @@ # along with this program. If not, see <https://www.gnu.org/licenses/>. import argparse -import os import sys import unittest @@ -30,34 +29,45 @@ class SetTypeTests(unittest.TestCase): """Tests the set type.""" + _TEST_DATA = bytes(bytearray([ + 0x89, 0x00, 0x00, 0x00, 0x31, 0x53, 0x50, 0x53, 0xe2, 0x8a, 0x58, 0x46, + 0xbc, 0x4c, 0x38, 0x43, 0xbb, 0xfc, 0x13, 0x93, 0x26, 0x98, 0x6d, 0xce, + 0x6d, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, 0x1f, 0x00, 0x00, + 0x00, 0x2e, 0x00, 0x00, 0x00, 0x53, 0x00, 0x2d, 0x00, 0x31, 0x00, 0x2d, + 0x00, 0x35, 0x00, 0x2d, 0x00, 0x32, 0x00, 0x31, 0x00, 0x2d, 0x00, 0x34, + 0x00, 0x30, 0x00, 0x36, 0x00, 0x30, 0x00, 0x32, 0x00, 0x38, 0x00, 0x39, + 0x00, 0x33, 0x00, 0x32, 0x00, 0x33, 0x00, 0x2d, 0x00, 0x31, 0x00, 0x39, + 0x00, 0x39, 0x00, 0x37, 0x00, 0x30, 0x00, 0x31, 0x00, 0x30, 0x00, 0x32, + 0x00, 0x32, 0x00, 0x2d, 0x00, 0x33, 0x00, 0x39, 0x00, 0x32, 0x00, 0x34, + 0x00, 0x38, 0x00, 0x30, 0x00, 0x31, 0x00, 0x36, 0x00, 0x38, 0x00, 0x31, + 0x00, 0x2d, 0x00, 0x31, 0x00, 0x30, 0x00, 0x30, 0x00, 0x30, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00])) + def test_get_number_of_records(self): """Tests the get_number_of_records function and number_of_records property.""" - test_source = getattr(unittest, "source", None) - if not test_source: - raise unittest.SkipTest("missing source") - fwps_set = pyfwps.set() - fwps_set.open(test_source) + fwps_set.copy_from_byte_stream(self._TEST_DATA) number_of_records = fwps_set.get_number_of_records() - self.assertIsNotNone(number_of_records) + self.assertEqual(number_of_records, 1) - self.assertIsNotNone(fwps_set.number_of_records) + self.assertEqual(fwps_set.number_of_records, 1) + + def test_get_record(self): + """Tests the get_record function.""" + fwps_set = pyfwps.set() - fwps_set.close() + fwps_set.copy_from_byte_stream(self._TEST_DATA) + + fwps_record = fwps_set.get_record(0) + self.assertIsNotNone(fwps_record) if __name__ == "__main__": argument_parser = argparse.ArgumentParser() - argument_parser.add_argument( - "source", nargs="?", action="store", metavar="PATH", - default=None, help="The path of the source file.") - options, unknown_options = argument_parser.parse_known_args() unknown_options.insert(0, sys.argv[0]) - setattr(unittest, "source", options.source) - unittest.main(argv=unknown_options, verbosity=2) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libfwps-20240225/tests/pyfwps_test_store.py new/libfwps-20240301/tests/pyfwps_test_store.py --- old/libfwps-20240225/tests/pyfwps_test_store.py 2024-02-24 15:40:29.000000000 +0100 +++ new/libfwps-20240301/tests/pyfwps_test_store.py 2024-03-01 12:37:49.000000000 +0100 @@ -20,7 +20,6 @@ # along with this program. If not, see <https://www.gnu.org/licenses/>. import argparse -import os import sys import unittest @@ -30,34 +29,46 @@ class StoreTypeTests(unittest.TestCase): """Tests the store type.""" + _TEST_DATA = bytes(bytearray([ + 0x89, 0x00, 0x00, 0x00, 0x31, 0x53, 0x50, 0x53, 0xe2, 0x8a, 0x58, 0x46, + 0xbc, 0x4c, 0x38, 0x43, 0xbb, 0xfc, 0x13, 0x93, 0x26, 0x98, 0x6d, 0xce, + 0x6d, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, 0x1f, 0x00, 0x00, + 0x00, 0x2e, 0x00, 0x00, 0x00, 0x53, 0x00, 0x2d, 0x00, 0x31, 0x00, 0x2d, + 0x00, 0x35, 0x00, 0x2d, 0x00, 0x32, 0x00, 0x31, 0x00, 0x2d, 0x00, 0x34, + 0x00, 0x30, 0x00, 0x36, 0x00, 0x30, 0x00, 0x32, 0x00, 0x38, 0x00, 0x39, + 0x00, 0x33, 0x00, 0x32, 0x00, 0x33, 0x00, 0x2d, 0x00, 0x31, 0x00, 0x39, + 0x00, 0x39, 0x00, 0x37, 0x00, 0x30, 0x00, 0x31, 0x00, 0x30, 0x00, 0x32, + 0x00, 0x32, 0x00, 0x2d, 0x00, 0x33, 0x00, 0x39, 0x00, 0x32, 0x00, 0x34, + 0x00, 0x38, 0x00, 0x30, 0x00, 0x31, 0x00, 0x36, 0x00, 0x38, 0x00, 0x31, + 0x00, 0x2d, 0x00, 0x31, 0x00, 0x30, 0x00, 0x30, 0x00, 0x30, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00])) + def test_get_number_of_sets(self): """Tests the get_number_of_sets function and number_of_sets property.""" - test_source = getattr(unittest, "source", None) - if not test_source: - raise unittest.SkipTest("missing source") - fwps_store = pyfwps.store() - fwps_store.open(test_source) + fwps_store.copy_from_byte_stream(self._TEST_DATA) number_of_sets = fwps_store.get_number_of_sets() - self.assertIsNotNone(number_of_sets) + self.assertEqual(number_of_sets, 1) - self.assertIsNotNone(fwps_store.number_of_sets) + self.assertEqual(fwps_store.number_of_sets, 1) + + def test_get_set(self): + """Tests the get_set function.""" + fwps_store = pyfwps.store() - fwps_store.close() + fwps_store.copy_from_byte_stream(self._TEST_DATA) + + fwps_set = fwps_store.get_set(0) + self.assertIsNotNone(fwps_set) if __name__ == "__main__": argument_parser = argparse.ArgumentParser() - argument_parser.add_argument( - "source", nargs="?", action="store", metavar="PATH", - default=None, help="The path of the source file.") - options, unknown_options = argument_parser.parse_known_args() unknown_options.insert(0, sys.argv[0]) - setattr(unittest, "source", options.source) - unittest.main(argv=unknown_options, verbosity=2) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libfwps-20240225/tests/test_python_module.sh new/libfwps-20240301/tests/test_python_module.sh --- old/libfwps-20240225/tests/test_python_module.sh 2024-02-24 15:39:39.000000000 +0100 +++ new/libfwps-20240301/tests/test_python_module.sh 2024-03-01 12:37:49.000000000 +0100 @@ -8,7 +8,7 @@ EXIT_NO_TESTS_RAN=5; EXIT_IGNORE=77; -TEST_FUNCTIONS="support"; +TEST_FUNCTIONS="record set store support"; TEST_FUNCTIONS_WITH_INPUT=""; OPTION_SETS=();