Update to 1.2.0

This commit is contained in:
Yaakov Selkowitz 2023-07-25 18:57:51 -04:00
parent a4822eb066
commit 38c414b5ba
5 changed files with 10 additions and 173 deletions

1
.gitignore vendored
View File

@ -7,3 +7,4 @@ libsndfile-1.0.21.tar.gz
/libsndfile-1.0.28.tar.gz
/libsndfile-1.0.31.tar.bz2
/libsndfile-1.1.0.tar.xz
/libsndfile-1.2.0.tar.xz

View File

@ -36,7 +36,7 @@ diff -up libsndfile-1.1.0/CMakeLists.txt.system-gsm libsndfile-1.1.0/CMakeLists.
@@ -412,6 +394,7 @@ target_link_libraries (sndfile
$<$<BOOL:${HAVE_EXTERNAL_XIPH_LIBS}>:Opus::opus>
$<$<BOOL:${HAVE_MPEG}>:MPG123::libmpg123>
$<$<BOOL:${HAVE_MPEG}>:Lame::Lame>
$<$<BOOL:${HAVE_MPEG}>:mp3lame::mp3lame>
+ -lgsm
)
set_target_properties (sndfile PROPERTIES
@ -46,7 +46,7 @@ diff -up libsndfile-1.1.0/Makefile.am.system-gsm libsndfile-1.1.0/Makefile.am
+++ libsndfile-1.1.0/Makefile.am 2022-04-25 22:39:56.976112391 +0200
@@ -47,7 +47,6 @@ SYMBOL_FILES = src/Symbols.gnu-binutils
EXTRA_DIST += include/sndfile.h.in src/config.h.in src/test_endswap.tpl src/test_endswap.def \
EXTRA_DIST += src/config.h.in src/test_endswap.tpl src/test_endswap.def \
$(SYMBOL_FILES) src/create_symbols_file.py src/binheader_writef_check.py \
- src/GSM610/README src/GSM610/COPYRIGHT src/GSM610/ChangeLog \
src/G72x/README src/G72x/README.original src/G72x/ChangeLog \

View File

@ -1,160 +0,0 @@
From cefd7b59df628eca240af3c136d66137c8e94888 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?IOhannes=20m=20zm=C3=B6lnig?= <zmoelnig@iem.at>
Date: Thu, 8 Sep 2022 10:49:36 +0200
Subject: [PATCH] tests: Use fuzzy comparison in test-suite
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Using exact comparison ("a == b") when comparing expected with computed
test data fails the test-suite on many architectures (including, but not
limited to armhf and arm64).
Instead, use epsilon(for now, FLT_EPSILON and DBL_EPSILON) to compare
floating point numbers for equality.
Closes: https://github.com/libsndfile/libsndfile/issues/866
Signed-off-by: IOhannes m zmölnig <zmoelnig@iem.at>
---
tests/utils.tpl | 27 +++++++++++++++++++++++++--
1 file changed, 25 insertions(+), 2 deletions(-)
diff --git a/tests/utils.tpl b/tests/utils.tpl
index c68e3a26e..0d1cd8bb9 100644
--- a/tests/utils.tpl
+++ b/tests/utils.tpl
@@ -193,6 +193,7 @@ sf_count_t file_length_fd (int fd) ;
#include <string.h>
#include <ctype.h>
#include <math.h>
+#include <float.h>
#include <fcntl.h>
#include <sys/stat.h>
@@ -215,6 +216,28 @@ sf_count_t file_length_fd (int fd) ;
#define O_BINARY 0
#endif
+
+/*
+** Compare for equality, with epsilon
+*/
+static inline int
+equals_short (const short a, const short b)
+{ return (a == b);
+} /* equals_short */
+static inline int
+equals_int (const int a, const int b)
+{ return (a == b);
+} /* equals_int */
+static inline int
+equals_float (const float a, const float b)
+{ return (fabsf(a - b) <= FLT_EPSILON);
+} /* equals_float */
+static inline int
+equals_double (const double a, const double b)
+{ return (fabs(a - b) <= DBL_EPSILON);
+} /* equals_double */
+
+
[+ FOR float_type +]
void
gen_windowed_sine_[+ (get "name") +] ([+ (get "name") +] *data, int len, double maximum)
@@ -752,8 +775,8 @@ compare_[+ (get "io_element") +]_or_die (const [+ (get "io_element") +] *expecte
unsigned k ;
for (k = 0 ; k < count ; k++)
- if (expected [k] != actual [k])
- { printf ("\n\nLine %d : Error at index %d, got " [+ (get "format_str") +] ", should be " [+ (get "format_str") +] ".\n\n", line_num, k, actual [k], expected [k]) ;
+ if (!equals_[+ (get "io_element") +](expected [k], actual [k]))
+ { printf ("\n\nLine %d : Error at index %d, got " [+ (get "format_str") +] ", should be " [+ (get "format_str") +] "(delta=" [+ (get "format_str") +] " ).\n\n", line_num, k, actual [k], expected [k], actual [k] - expected [k]) ;
exit (1) ;
} ;
diff --git a/tests/utils.c b/tests/utils.c
index c239606..b1adf29 100644
--- a/tests/utils.c
+++ b/tests/utils.c
@@ -43,6 +43,7 @@
#include <string.h>
#include <ctype.h>
#include <math.h>
+#include <float.h>
#include <fcntl.h>
#include <sys/stat.h>
@@ -66,6 +67,28 @@
#endif
+/*
+** Compare for equality, with epsilon
+*/
+static inline int
+equals_short (const short a, const short b)
+{ return (a == b);
+} /* equals_short */
+static inline int
+equals_int (const int a, const int b)
+{ return (a == b);
+} /* equals_int */
+static inline int
+equals_float (const float a, const float b)
+{ return (fabsf(a - b) <= FLT_EPSILON);
+} /* equals_float */
+static inline int
+equals_double (const double a, const double b)
+{ return (fabs(a - b) <= DBL_EPSILON);
+} /* equals_double */
+
+
+
void
gen_windowed_sine_float (float *data, int len, double maximum)
{ int k ;
@@ -958,8 +981,8 @@ compare_short_or_die (const short *expected, const short *actual, unsigned count
unsigned k ;
for (k = 0 ; k < count ; k++)
- if (expected [k] != actual [k])
- { printf ("\n\nLine %d : Error at index %d, got " "% d" ", should be " "% d" ".\n\n", line_num, k, actual [k], expected [k]) ;
+ if (!equals_short(expected [k], actual [k]))
+ { printf ("\n\nLine %d : Error at index %d, got " "% d" ", should be " "% d" "(delta=" "% d" " ).\n\n", line_num, k, actual [k], expected [k], actual [k] - expected [k]) ;
exit (1) ;
} ;
@@ -971,8 +994,8 @@ compare_int_or_die (const int *expected, const int *actual, unsigned count, int
unsigned k ;
for (k = 0 ; k < count ; k++)
- if (expected [k] != actual [k])
- { printf ("\n\nLine %d : Error at index %d, got " "% d" ", should be " "% d" ".\n\n", line_num, k, actual [k], expected [k]) ;
+ if (!equals_int(expected [k], actual [k]))
+ { printf ("\n\nLine %d : Error at index %d, got " "% d" ", should be " "% d" "(delta=" "% d" " ).\n\n", line_num, k, actual [k], expected [k], actual [k] - expected [k]) ;
exit (1) ;
} ;
@@ -984,8 +1007,8 @@ compare_float_or_die (const float *expected, const float *actual, unsigned count
unsigned k ;
for (k = 0 ; k < count ; k++)
- if (expected [k] != actual [k])
- { printf ("\n\nLine %d : Error at index %d, got " "% g" ", should be " "% g" ".\n\n", line_num, k, actual [k], expected [k]) ;
+ if (!equals_float(expected [k], actual [k]))
+ { printf ("\n\nLine %d : Error at index %d, got " "% g" ", should be " "% g" "(delta=" "% g" " ).\n\n", line_num, k, actual [k], expected [k], actual [k] - expected [k]) ;
exit (1) ;
} ;
@@ -997,8 +1020,8 @@ compare_double_or_die (const double *expected, const double *actual, unsigned co
unsigned k ;
for (k = 0 ; k < count ; k++)
- if (expected [k] != actual [k])
- { printf ("\n\nLine %d : Error at index %d, got " "% g" ", should be " "% g" ".\n\n", line_num, k, actual [k], expected [k]) ;
+ if (!equals_double(expected [k], actual [k]))
+ { printf ("\n\nLine %d : Error at index %d, got " "% g" ", should be " "% g" "(delta=" "% g" " ).\n\n", line_num, k, actual [k], expected [k], actual [k] - expected [k]) ;
exit (1) ;
} ;

View File

@ -1,12 +1,11 @@
Summary: Library for reading and writing sound files
Name: libsndfile
Version: 1.1.0
Release: 9%{?dist}
Version: 1.2.0
Release: 1%{?dist}
License: LGPL-2.1-or-later AND GPL-2.0-or-later AND BSD-3-Clause
URL: http://libsndfile.github.io/libsndfile/
Source0: https://github.com/libsndfile/libsndfile/releases/download/%{version}/libsndfile-%{version}.tar.xz
Patch0: libsndfile-1.0.25-system-gsm.patch
Patch1: libsndfile-1.1.0-cefd7b59.patch
%if %{undefined rhel}
# used to regenerate test .c sources from .def files
BuildRequires: autogen
@ -61,7 +60,6 @@ This package contains command line utilities for libsndfile.
%prep
%setup -q
%patch -P0 -p1 -b .system-gsm
%patch -P1 -p1 -b .cefd7b59
rm -r src/GSM610
%build
@ -78,11 +76,6 @@ autoreconf -I M4 -fiv # for system-gsm patch
sed -i 's|^hardcode_libdir_flag_spec=.*|hardcode_libdir_flag_spec=""|g' libtool
sed -i 's|^runpath_var=LD_RUN_PATH|runpath_var=DIE_RPATH_DIE|g' libtool
%if %{defined rhel}
# avoid regeneration with autogen
touch tests/*.def tests/*.c
%endif
%make_build
@ -127,7 +120,7 @@ LD_LIBRARY_PATH=$PWD/src/.libs make check
%license COPYING
# NEWS files is missing in 1.1.0, check if it was re-added
%doc AUTHORS README
%{_libdir}/%{name}.so.*
%{_libdir}/%{name}.so.1{,.*}
%files utils
%{_bindir}/sndfile-cmp
@ -161,6 +154,9 @@ LD_LIBRARY_PATH=$PWD/src/.libs make check
%changelog
* Tue Jul 25 2023 Yaakov Selkowitz <yselkowi@redhat.com> - 1.2.0-1
- Update to 1.2.0
* Thu Jul 20 2023 Fedora Release Engineering <releng@fedoraproject.org> - 1.1.0-9
- Rebuilt for https://fedoraproject.org/wiki/Fedora_39_Mass_Rebuild

View File

@ -1 +1 @@
SHA512 (libsndfile-1.1.0.tar.xz) = d01696a8a88a4444e5eb91a137cf7b26b55b12c1fe3b648653f7e78674bbdf61870066216c9ff2f6a1e63bdf7b558af9a759480cf6523b607d29347b12762006
SHA512 (libsndfile-1.2.0.tar.xz) = c0dee6b33cd3c619aa13ec2854a5480e826640ca98a438758346194e83752af576a39f9de118824f0d0c61288632d87b489dc5793c025296e0f15564d87ca12a