mirror of
https://github.com/cookiengineer/audacity
synced 2025-11-21 16:37:12 +01:00
Update libsndfile to 1.0.29pre2+git
This pulls in MANY (over 890) changes compared to our from our current 1.0.24 version.
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
** Copyright (C) 1999-2011 Erik de Castro Lopo <erikd@mega-nerd.com>
|
||||
** Copyright (C) 1999-2018 Erik de Castro Lopo <erikd@mega-nerd.com>
|
||||
**
|
||||
** This program is free software; you can redistribute it and/or modify
|
||||
** it under the terms of the GNU General Public License as published by
|
||||
@@ -21,9 +21,12 @@
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <errno.h>
|
||||
|
||||
#if HAVE_UNISTD_H
|
||||
#include <unistd.h>
|
||||
#else
|
||||
#include "sf_unistd.h"
|
||||
#endif
|
||||
|
||||
#if OS_IS_WIN32
|
||||
@@ -34,7 +37,7 @@
|
||||
|
||||
#include "utils.h"
|
||||
|
||||
#define BUFFER_SIZE (1<<15)
|
||||
#define BUFFER_SIZE (1 << 15)
|
||||
#define SHORT_BUFFER (256)
|
||||
|
||||
static void
|
||||
@@ -83,6 +86,8 @@ error_value_test (void)
|
||||
|
||||
dump_data_to_file (filename, aiff_data, sizeof (aiff_data)) ;
|
||||
|
||||
memset (&sfinfo, 0, sizeof (sfinfo)) ;
|
||||
|
||||
file = sf_open (filename, SFM_READ, &sfinfo) ;
|
||||
if (file != NULL)
|
||||
{ printf ("\n\nLine %d : Should not have been able to open this file.\n\n", __LINE__) ;
|
||||
@@ -229,6 +234,40 @@ error_close_test (void)
|
||||
puts ("ok") ;
|
||||
} /* error_close_test */
|
||||
|
||||
static void
|
||||
unrecognised_test (void)
|
||||
{ const char *filename = "unrecognised.bin" ;
|
||||
SNDFILE *sndfile ;
|
||||
SF_INFO sfinfo ;
|
||||
FILE *file ;
|
||||
int k ;
|
||||
|
||||
print_test_name (__func__, filename) ;
|
||||
|
||||
file = fopen (filename, "wb") ;
|
||||
exit_if_true (file == NULL,
|
||||
"\n\nLine %d : fopen ('%s') failed : %s\n", __LINE__, filename, strerror (errno)
|
||||
) ;
|
||||
fputs ("Unrecognised file", file) ;
|
||||
fclose (file) ;
|
||||
|
||||
memset (&sfinfo, 0, sizeof (sfinfo)) ;
|
||||
sndfile = sf_open (filename, SFM_READ, &sfinfo) ;
|
||||
|
||||
exit_if_true (sndfile != NULL,
|
||||
"\n\nLine %d : SNDFILE* pointer (%p) should ne NULL.\n", __LINE__, sndfile
|
||||
) ;
|
||||
|
||||
k = sf_error (sndfile) ;
|
||||
exit_if_true (k != SF_ERR_UNRECOGNISED_FORMAT,
|
||||
"\n\nLine %d : error (%d) should have been SF_ERR_UNRECOGNISED_FORMAT (%d).\n",
|
||||
__LINE__, k, SF_ERR_UNRECOGNISED_FORMAT
|
||||
) ;
|
||||
|
||||
unlink (filename) ;
|
||||
puts ("ok") ;
|
||||
} /* unrecognised_test */
|
||||
|
||||
int
|
||||
main (void)
|
||||
{
|
||||
@@ -241,6 +280,8 @@ main (void)
|
||||
zero_length_test ("zero_length.wav") ;
|
||||
bad_wav_test ("bad_wav.wav") ;
|
||||
|
||||
unrecognised_test () ;
|
||||
|
||||
return 0 ;
|
||||
} /* main */
|
||||
|
||||
|
||||
Reference in New Issue
Block a user