mirror of
https://gitee.com/openharmony/third_party_libsnd
synced 2024-11-23 01:49:53 +00:00
tests/utils.(def|tpl) : Add compare_XXX_or_die functions.
This commit is contained in:
parent
93878894aa
commit
19f5d65794
@ -4,6 +4,9 @@
|
||||
Add a test (currently failing) for stereo seeking on Ogg Vorbis files. Test
|
||||
case supplied by Bodo.
|
||||
|
||||
* tests/utils.(def|tpl)
|
||||
Add compare_XXX_or_die functions.
|
||||
|
||||
2007-12-05 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
|
||||
|
||||
* src/aiff.c
|
||||
|
@ -12,22 +12,22 @@ float_type = {
|
||||
|
||||
io_type = {
|
||||
io_element = short ;
|
||||
format_str = "\"% d\\n\"" ;
|
||||
format_str = "\"% d\"" ;
|
||||
};
|
||||
|
||||
io_type = {
|
||||
io_element = int ;
|
||||
format_str = "\"% d\\n\"" ;
|
||||
format_str = "\"% d\"" ;
|
||||
};
|
||||
|
||||
io_type = {
|
||||
io_element = float ;
|
||||
format_str = "\"% g\\n\"" ;
|
||||
format_str = "\"% g\"" ;
|
||||
};
|
||||
|
||||
io_type = {
|
||||
io_element = double ;
|
||||
format_str = "\"% g\\n\"" ;
|
||||
format_str = "\"% g\"" ;
|
||||
};
|
||||
|
||||
read_op = {
|
||||
|
@ -1,6 +1,6 @@
|
||||
[+ AutoGen5 template h c +]
|
||||
/*
|
||||
** Copyright (C) 2002-2005 Erik de Castro Lopo <erikd@mega-nerd.com>
|
||||
** Copyright (C) 2002-2007 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
|
||||
@ -114,6 +114,11 @@ void test_seek_or_die
|
||||
(SNDFILE *file, int pass, const [+ (get "io_element") +] *test, sf_count_t [+ (get "count_name") +], int line_num) ;
|
||||
[+ ENDFOR io_type +][+ ENDFOR write_op +]
|
||||
|
||||
[+ FOR io_type
|
||||
+]void compare_[+ (get "io_element") +]_or_die (const [+ (get "io_element") +] *left, const [+ (get "io_element") +] *right, unsigned count, int line_num) ;
|
||||
[+ ENDFOR io_type +]
|
||||
|
||||
|
||||
void gen_lowpass_noise_float (float *data, int len) ;
|
||||
|
||||
int file_length (const char * fname) ;
|
||||
@ -290,7 +295,7 @@ oct_save_[+ (get "io_element") +] (const [+ (get "io_element") +] *a, const [+ (
|
||||
fprintf (file, "# columns: 1\n") ;
|
||||
|
||||
for (k = 0 ; k < len ; k++)
|
||||
fprintf (file, [+ (get "format_str") +], a [k]) ;
|
||||
fprintf (file, [+ (get "format_str") +] "\n", a [k]) ;
|
||||
|
||||
fprintf (file, "# name: b\n") ;
|
||||
fprintf (file, "# type: matrix\n") ;
|
||||
@ -298,7 +303,7 @@ oct_save_[+ (get "io_element") +] (const [+ (get "io_element") +] *a, const [+ (
|
||||
fprintf (file, "# columns: 1\n") ;
|
||||
|
||||
for (k = 0 ; k < len ; k++)
|
||||
fprintf (file, [+ (get "format_str") +], b [k]) ;
|
||||
fprintf (file, [+ (get "format_str") +] "\n", b [k]) ;
|
||||
|
||||
fclose (file) ;
|
||||
return 0 ;
|
||||
@ -622,6 +627,23 @@ test_[+ (get "op_element") +]_[+ (get "io_element") +]_or_die (SNDFILE *file, in
|
||||
} /* test_[+ (get "op_element") +]_[+ (get "io_element") +] */
|
||||
[+ ENDFOR io_type +][+ ENDFOR write_op +]
|
||||
|
||||
[+ FOR io_type
|
||||
+]void
|
||||
compare_[+ (get "io_element") +]_or_die (const [+ (get "io_element") +] *left, const [+ (get "io_element") +] *right, unsigned count, int line_num)
|
||||
{
|
||||
unsigned k ;
|
||||
|
||||
for (k = 0 ; k < count ;k++)
|
||||
if (left [k] != right [k])
|
||||
{ printf ("\n\nLine %d : Error at index %d, " [+ (get "format_str") +] " should be " [+ (get "format_str") +] ".\n\n", line_num, k, left [k], right [k]) ;
|
||||
exit (1) ;
|
||||
} ;
|
||||
|
||||
return ;
|
||||
} /* compare_[+ (get "io_element") +]_or_die */
|
||||
[+ ENDFOR io_type +]
|
||||
|
||||
|
||||
void
|
||||
delete_file (int format, const char *filename)
|
||||
{ char rsrc_name [512], *fname ;
|
||||
|
Loading…
Reference in New Issue
Block a user