mirror of
https://gitee.com/openharmony/third_party_libsnd
synced 2024-11-23 09:59:54 +00:00
Update usage of check_log_buffer_or_die().
This commit is contained in:
parent
b164e152cf
commit
919e5d2a56
@ -128,7 +128,7 @@ rw_test (const char *filename)
|
||||
{ printf ("\n\nLine %d : sf_open SFM_READ failed : %s\n\n", __LINE__, sf_strerror (NULL)) ;
|
||||
exit (1) ;
|
||||
} ;
|
||||
check_log_buffer_or_die (file) ;
|
||||
check_log_buffer_or_die (file, __LINE__) ;
|
||||
sf_close (file) ;
|
||||
|
||||
/* Now open read/write and close the file. */
|
||||
@ -136,7 +136,7 @@ rw_test (const char *filename)
|
||||
{ printf ("\n\nLine %d : sf_open SFM_RDWR failed : %s\n\n", __LINE__, sf_strerror (NULL)) ;
|
||||
exit (1) ;
|
||||
} ;
|
||||
check_log_buffer_or_die (file) ;
|
||||
check_log_buffer_or_die (file, __LINE__) ;
|
||||
sf_close (file) ;
|
||||
|
||||
/* Open again as read only again and fill in a new SF_INFO struct. */
|
||||
@ -145,7 +145,7 @@ rw_test (const char *filename)
|
||||
{ printf ("\n\nLine %d : sf_open SFM_RDWR failed : %s\n\n", __LINE__, sf_strerror (NULL)) ;
|
||||
exit (1) ;
|
||||
} ;
|
||||
check_log_buffer_or_die (file) ;
|
||||
check_log_buffer_or_die (file, __LINE__) ;
|
||||
sf_close (file) ;
|
||||
|
||||
/* Now compare the two. */
|
||||
|
@ -78,7 +78,7 @@ main (void)
|
||||
exit (1) ;
|
||||
} ;
|
||||
|
||||
check_log_buffer_or_die (file) ;
|
||||
check_log_buffer_or_die (file, __LINE__) ;
|
||||
|
||||
if (sf_read_raw (file, alaw_buffer, BUFFER_SIZE) != BUFFER_SIZE)
|
||||
{ printf ("sf_read_raw : ") ;
|
||||
@ -122,7 +122,7 @@ main (void)
|
||||
exit (1) ;
|
||||
} ;
|
||||
|
||||
check_log_buffer_or_die (file) ;
|
||||
check_log_buffer_or_die (file, __LINE__) ;
|
||||
|
||||
if (sf_read_short (file, short_buffer, 256) != 256)
|
||||
{ printf ("sf_read_short : ") ;
|
||||
|
@ -132,7 +132,7 @@ lcomp_test_int (const char *str, const char *filename, int filetype, double marg
|
||||
exit (1) ;
|
||||
} ;
|
||||
|
||||
check_log_buffer_or_die (file) ;
|
||||
check_log_buffer_or_die (file, __LINE__) ;
|
||||
|
||||
if ((k = sf_readf_int (file, data, datalen)) != datalen)
|
||||
{ printf ("Line %d: short read (%d should be %ld).\n", __LINE__, k, datalen) ;
|
||||
|
@ -198,7 +198,7 @@ float_scaled_test (const char *filename, int allow_exit, int replace_float, int
|
||||
exit (1) ;
|
||||
} ;
|
||||
|
||||
check_log_buffer_or_die (file) ;
|
||||
check_log_buffer_or_die (file, __LINE__) ;
|
||||
|
||||
test_read_float_or_die (file, 0, float_test, DFT_DATA_LENGTH, __LINE__) ;
|
||||
|
||||
@ -259,7 +259,7 @@ double_scaled_test (const char *filename, int allow_exit, int replace_float, int
|
||||
exit (1) ;
|
||||
} ;
|
||||
|
||||
check_log_buffer_or_die (file) ;
|
||||
check_log_buffer_or_die (file, __LINE__) ;
|
||||
|
||||
test_read_double_or_die (file, 0, test_data, DFT_DATA_LENGTH, __LINE__) ;
|
||||
|
||||
|
@ -97,7 +97,7 @@ main (void)
|
||||
exit (1) ;
|
||||
} ;
|
||||
|
||||
check_log_buffer_or_die (file) ;
|
||||
check_log_buffer_or_die (file, __LINE__) ;
|
||||
|
||||
if ((k = sf_read_short (file, buffer, BUFFER_SIZE)) != BUFFER_SIZE)
|
||||
{ printf ("Line %d: short read (%d).\n", __LINE__, k) ;
|
||||
|
@ -500,7 +500,7 @@ lcomp_test_short (const char *filename, int filetype, int channels, double margi
|
||||
exit (1) ;
|
||||
} ;
|
||||
|
||||
check_log_buffer_or_die (file) ;
|
||||
check_log_buffer_or_die (file, __LINE__) ;
|
||||
|
||||
if ((k = sf_readf_short (file, data, datalen)) != datalen)
|
||||
{ printf ("Line %d: short read (%d should be %ld).\n", __LINE__, k, datalen) ;
|
||||
@ -707,7 +707,7 @@ lcomp_test_int (const char *filename, int filetype, int channels, double margin)
|
||||
exit (1) ;
|
||||
} ;
|
||||
|
||||
check_log_buffer_or_die (file) ;
|
||||
check_log_buffer_or_die (file, __LINE__) ;
|
||||
|
||||
if ((k = sf_readf_int (file, data, datalen)) != datalen)
|
||||
{ printf ("Line %d: short read (%d should be %ld).\n", __LINE__, k, datalen) ;
|
||||
@ -914,7 +914,7 @@ lcomp_test_float (const char *filename, int filetype, int channels, double margi
|
||||
|
||||
sf_command (file, SFC_SET_NORM_FLOAT, NULL, SF_FALSE) ;
|
||||
|
||||
check_log_buffer_or_die (file) ;
|
||||
check_log_buffer_or_die (file, __LINE__) ;
|
||||
|
||||
sf_command (file, SFC_SET_NORM_FLOAT, NULL, SF_FALSE) ;
|
||||
|
||||
@ -1123,7 +1123,7 @@ lcomp_test_double (const char *filename, int filetype, int channels, double marg
|
||||
|
||||
sf_command (file, SFC_SET_NORM_DOUBLE, NULL, SF_FALSE) ;
|
||||
|
||||
check_log_buffer_or_die (file) ;
|
||||
check_log_buffer_or_die (file, __LINE__) ;
|
||||
|
||||
sf_command (file, SFC_SET_NORM_DOUBLE, NULL, SF_FALSE) ;
|
||||
|
||||
@ -1333,7 +1333,7 @@ channels = 1 ;
|
||||
|
||||
sf_command (file, SFC_SET_NORM_FLOAT, NULL, SF_FALSE) ;
|
||||
|
||||
check_log_buffer_or_die (file) ;
|
||||
check_log_buffer_or_die (file, __LINE__) ;
|
||||
|
||||
if ((k = sf_read_short (file, data, datalen)) != datalen)
|
||||
{ printf ("Line %d: short read (%d should be %ld).\n", __LINE__, k, datalen) ;
|
||||
@ -1538,7 +1538,7 @@ channels = 1 ;
|
||||
exit (1) ;
|
||||
} ;
|
||||
|
||||
check_log_buffer_or_die (file) ;
|
||||
check_log_buffer_or_die (file, __LINE__) ;
|
||||
|
||||
if ((k = sf_readf_int (file, data, datalen)) != datalen)
|
||||
{ printf ("int read (%d).\n", k) ;
|
||||
@ -1751,7 +1751,7 @@ printf ("** fix this ** ") ;
|
||||
|
||||
sf_command (file, SFC_SET_NORM_FLOAT, NULL, SF_FALSE) ;
|
||||
|
||||
check_log_buffer_or_die (file) ;
|
||||
check_log_buffer_or_die (file, __LINE__) ;
|
||||
|
||||
if ((k = sf_read_float (file, data, datalen)) != datalen)
|
||||
{ printf ("int read (%d).\n", k) ;
|
||||
@ -1956,7 +1956,7 @@ channels = 1 ;
|
||||
|
||||
sf_command (file, SFC_SET_NORM_DOUBLE, NULL, SF_FALSE) ;
|
||||
|
||||
check_log_buffer_or_die (file) ;
|
||||
check_log_buffer_or_die (file, __LINE__) ;
|
||||
|
||||
if ((k = sf_read_double (file, data, datalen)) != datalen)
|
||||
{ printf ("int read (%d).\n", k) ;
|
||||
|
@ -178,7 +178,7 @@ pcm_test_[+ (get "name") +] (const char *filename, int filetype, int hash)
|
||||
exit (1) ;
|
||||
} ;
|
||||
|
||||
check_log_buffer_or_die (file) ;
|
||||
check_log_buffer_or_die (file, __LINE__) ;
|
||||
|
||||
test_read_short_or_die (file, 0, short_in, items, __LINE__) ;
|
||||
|
||||
@ -240,7 +240,7 @@ pcm_test_[+ (get "name") +] (const char *filename, int filetype, int hash)
|
||||
exit (1) ;
|
||||
} ;
|
||||
|
||||
check_log_buffer_or_die (file) ;
|
||||
check_log_buffer_or_die (file, __LINE__) ;
|
||||
|
||||
test_read_int_or_die (file, 0, int_in, items, __LINE__) ;
|
||||
|
||||
@ -302,7 +302,7 @@ pcm_test_[+ (get "name") +] (const char *filename, int filetype, int hash)
|
||||
exit (1) ;
|
||||
} ;
|
||||
|
||||
check_log_buffer_or_die (file) ;
|
||||
check_log_buffer_or_die (file, __LINE__) ;
|
||||
|
||||
sf_command (file, SFC_SET_NORM_FLOAT, NULL, SF_FALSE) ;
|
||||
|
||||
@ -366,7 +366,7 @@ pcm_test_[+ (get "name") +] (const char *filename, int filetype, int hash)
|
||||
exit (1) ;
|
||||
} ;
|
||||
|
||||
check_log_buffer_or_die (file) ;
|
||||
check_log_buffer_or_die (file, __LINE__) ;
|
||||
|
||||
sf_command (file, SFC_SET_NORM_DOUBLE, NULL, SF_FALSE) ;
|
||||
|
||||
@ -456,7 +456,7 @@ pcm_test_float (const char *filename, int filetype, int hash, int replace_float)
|
||||
exit (1) ;
|
||||
} ;
|
||||
|
||||
check_log_buffer_or_die (file) ;
|
||||
check_log_buffer_or_die (file, __LINE__) ;
|
||||
|
||||
test_read_double_or_die (file, 0, data, items, __LINE__) ;
|
||||
|
||||
@ -580,7 +580,7 @@ pcm_test_float (const char *filename, int filetype, int hash, int replace_float)
|
||||
exit (1) ;
|
||||
} ;
|
||||
|
||||
check_log_buffer_or_die (file) ;
|
||||
check_log_buffer_or_die (file, __LINE__) ;
|
||||
|
||||
test_readf_double_or_die (file, 0, data, frames, __LINE__) ;
|
||||
for (sign = -1, k = 0 ; k < items ; k++)
|
||||
@ -719,7 +719,7 @@ pcm_test_double (const char *filename, int filetype, int hash, int replace_float
|
||||
exit (1) ;
|
||||
} ;
|
||||
|
||||
check_log_buffer_or_die (file) ;
|
||||
check_log_buffer_or_die (file, __LINE__) ;
|
||||
|
||||
test_read_double_or_die (file, 0, data, items, __LINE__) ;
|
||||
|
||||
@ -853,7 +853,7 @@ pcm_test_double (const char *filename, int filetype, int hash, int replace_float
|
||||
exit (1) ;
|
||||
} ;
|
||||
|
||||
check_log_buffer_or_die (file) ;
|
||||
check_log_buffer_or_die (file, __LINE__) ;
|
||||
|
||||
test_readf_double_or_die (file, 0, data, frames, __LINE__) ;
|
||||
|
||||
|
@ -83,7 +83,7 @@ raw_offset_test (const char *filename, int typeminor)
|
||||
sf_close (sndfile) ;
|
||||
|
||||
sndfile = test_open_file_or_die (filename, SFM_READ, &sfinfo, __LINE__) ;
|
||||
check_log_buffer_or_die (sndfile) ;
|
||||
check_log_buffer_or_die (sndfile, __LINE__) ;
|
||||
|
||||
if (abs (BUFFER_LEN - sfinfo.frames) > 1)
|
||||
{ printf ("\n\nLine %d : Incorrect sample count (%ld should be %d)\n", __LINE__, SF_COUNT_TO_LONG (sfinfo.frames), BUFFER_LEN) ;
|
||||
|
@ -147,7 +147,7 @@ main (void)
|
||||
exit (1) ;
|
||||
} ;
|
||||
|
||||
check_log_buffer_or_die (file) ;
|
||||
check_log_buffer_or_die (file, __LINE__) ;
|
||||
|
||||
test_read_[+ (get "type_name") +]_or_die (file, 0, data_in, HALF_BUFFER_SIZE, __LINE__) ;
|
||||
sf_command (file, SFC_SET_NORM_[+ (get "upper_name") +], NULL, SF_FALSE) ;
|
||||
|
@ -135,7 +135,7 @@ string_test (const char *filename, int typemajor)
|
||||
|
||||
file = test_open_file_or_die (filename, SFM_READ, &sfinfo, __LINE__) ;
|
||||
|
||||
check_log_buffer_or_die (file) ;
|
||||
check_log_buffer_or_die (file, __LINE__) ;
|
||||
|
||||
if (sfinfo.frames != BUFFER_LEN)
|
||||
{ printf ("***** Bad frame count %d (should be %d)\n\n", (int) sfinfo.frames, BUFFER_LEN) ;
|
||||
|
@ -78,7 +78,7 @@ main (void)
|
||||
exit (1) ;
|
||||
} ;
|
||||
|
||||
check_log_buffer_or_die (file) ;
|
||||
check_log_buffer_or_die (file, __LINE__) ;
|
||||
|
||||
if (sf_read_raw (file, ulaw_buffer, BUFFER_SIZE) != BUFFER_SIZE)
|
||||
{ printf ("sf_read_raw : ") ;
|
||||
@ -122,7 +122,7 @@ main (void)
|
||||
exit (1) ;
|
||||
} ;
|
||||
|
||||
check_log_buffer_or_die (file) ;
|
||||
check_log_buffer_or_die (file, __LINE__) ;
|
||||
|
||||
if (sf_read_short (file, short_buffer, 256) != 256)
|
||||
{ printf ("sf_read_short : ") ;
|
||||
|
@ -388,7 +388,7 @@ pcm_test_[+ (get "type_name") +] (const char *filename, int filetype, int long_f
|
||||
exit (1) ;
|
||||
} ;
|
||||
|
||||
check_log_buffer_or_die (file) ;
|
||||
check_log_buffer_or_die (file, __LINE__) ;
|
||||
|
||||
test_read_[+ (get "data_type") +]_or_die (file, 0, test, items, __LINE__) ;
|
||||
for (k = 0 ; k < items ; k++)
|
||||
@ -652,7 +652,7 @@ pcm_test_[+ (get "type_name") +] (const char *filename, int filetype, int long_f
|
||||
exit (1) ;
|
||||
} ;
|
||||
|
||||
check_log_buffer_or_die (file) ;
|
||||
check_log_buffer_or_die (file, __LINE__) ;
|
||||
|
||||
test_readf_[+ (get "data_type") +]_or_die (file, 0, test, frames, __LINE__) ;
|
||||
for (k = 0 ; k < items ; k++)
|
||||
|
Loading…
Reference in New Issue
Block a user