misc_test.c 16 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533
  1. /*
  2. ** Copyright (C) 2001-2017 Erik de Castro Lopo <[email protected]>
  3. **
  4. ** This program is free software ; you can redistribute it and/or modify
  5. ** it under the terms of the GNU General Public License as published by
  6. ** the Free Software Foundation ; either version 2 of the License, or
  7. ** (at your option) any later version.
  8. **
  9. ** This program is distributed in the hope that it will be useful,
  10. ** but WITHOUT ANY WARRANTY ; without even the implied warranty of
  11. ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  12. ** GNU General Public License for more details.
  13. **
  14. ** You should have received a copy of the GNU General Public License
  15. ** along with this program ; if not, write to the Free Software
  16. ** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
  17. */
  18. #include "sfconfig.h"
  19. #include <stdio.h>
  20. #include <stdlib.h>
  21. #include <string.h>
  22. #include <errno.h>
  23. #include <inttypes.h>
  24. #include <sys/stat.h>
  25. #include <math.h>
  26. #if HAVE_UNISTD_H
  27. #include <unistd.h>
  28. #endif
  29. #if (HAVE_DECL_S_IRGRP == 0)
  30. #include <sf_unistd.h>
  31. #endif
  32. #if (defined (WIN32) || defined (_WIN32))
  33. #include <io.h>
  34. #include <direct.h>
  35. #endif
  36. #include <sndfile.h>
  37. #include "utils.h"
  38. #define BUFFER_LEN (1 << 10)
  39. #define LOG_BUFFER_SIZE 1024
  40. static void zero_data_test (const char *filename, int format) ;
  41. static void filesystem_full_test (int format) ;
  42. static void permission_test (const char *filename, int typemajor) ;
  43. static void wavex_amb_test (const char *filename) ;
  44. static void rf64_downgrade_test (const char *filename) ;
  45. static void rf64_long_file_downgrade_test (const char *filename) ;
  46. int
  47. main (int argc, char *argv [])
  48. { int do_all = 0 ;
  49. int test_count = 0 ;
  50. if (argc != 2)
  51. { printf ("Usage : %s <test>\n", argv [0]) ;
  52. printf (" Where <test> is one of the following:\n") ;
  53. printf (" wav - test WAV file peak chunk\n") ;
  54. printf (" aiff - test AIFF file PEAK chunk\n") ;
  55. printf (" all - perform all tests\n") ;
  56. exit (1) ;
  57. } ;
  58. do_all = ! strcmp (argv [1], "all") ;
  59. if (do_all || ! strcmp (argv [1], "wav"))
  60. { zero_data_test ("zerolen.wav", SF_FORMAT_WAV | SF_FORMAT_PCM_16) ;
  61. filesystem_full_test (SF_FORMAT_WAV | SF_FORMAT_PCM_16) ;
  62. permission_test ("readonly.wav", SF_FORMAT_WAV) ;
  63. wavex_amb_test ("ambisonic.wav") ;
  64. test_count++ ;
  65. } ;
  66. if (do_all || ! strcmp (argv [1], "aiff"))
  67. { zero_data_test ("zerolen.aiff", SF_FORMAT_AIFF | SF_FORMAT_PCM_16) ;
  68. filesystem_full_test (SF_FORMAT_AIFF | SF_FORMAT_PCM_16) ;
  69. permission_test ("readonly.aiff", SF_FORMAT_AIFF) ;
  70. test_count++ ;
  71. } ;
  72. if (do_all || ! strcmp (argv [1], "au"))
  73. { zero_data_test ("zerolen.au", SF_FORMAT_AU | SF_FORMAT_PCM_16) ;
  74. filesystem_full_test (SF_FORMAT_AU | SF_FORMAT_PCM_16) ;
  75. permission_test ("readonly.au", SF_FORMAT_AU) ;
  76. test_count++ ;
  77. } ;
  78. if (do_all || ! strcmp (argv [1], "caf"))
  79. { zero_data_test ("zerolen.caf", SF_FORMAT_CAF | SF_FORMAT_PCM_16) ;
  80. filesystem_full_test (SF_FORMAT_CAF | SF_FORMAT_PCM_16) ;
  81. permission_test ("readonly.caf", SF_FORMAT_CAF) ;
  82. test_count++ ;
  83. } ;
  84. if (do_all || ! strcmp (argv [1], "svx"))
  85. { zero_data_test ("zerolen.svx", SF_FORMAT_SVX | SF_FORMAT_PCM_16) ;
  86. filesystem_full_test (SF_FORMAT_SVX | SF_FORMAT_PCM_16) ;
  87. permission_test ("readonly.svx", SF_FORMAT_SVX) ;
  88. test_count++ ;
  89. } ;
  90. if (do_all || ! strcmp (argv [1], "nist"))
  91. { zero_data_test ("zerolen.nist", SF_FORMAT_NIST | SF_FORMAT_PCM_16) ;
  92. filesystem_full_test (SF_FORMAT_NIST | SF_FORMAT_PCM_16) ;
  93. permission_test ("readonly.nist", SF_FORMAT_NIST) ;
  94. test_count++ ;
  95. } ;
  96. if (do_all || ! strcmp (argv [1], "paf"))
  97. { zero_data_test ("zerolen.paf", SF_FORMAT_PAF | SF_FORMAT_PCM_16) ;
  98. filesystem_full_test (SF_FORMAT_PAF | SF_FORMAT_PCM_16) ;
  99. permission_test ("readonly.paf", SF_FORMAT_PAF) ;
  100. test_count++ ;
  101. } ;
  102. if (do_all || ! strcmp (argv [1], "ircam"))
  103. { zero_data_test ("zerolen.ircam", SF_FORMAT_IRCAM | SF_FORMAT_PCM_16) ;
  104. filesystem_full_test (SF_FORMAT_IRCAM | SF_FORMAT_PCM_16) ;
  105. permission_test ("readonly.ircam", SF_FORMAT_IRCAM) ;
  106. test_count++ ;
  107. } ;
  108. if (do_all || ! strcmp (argv [1], "voc"))
  109. { zero_data_test ("zerolen.voc", SF_FORMAT_VOC | SF_FORMAT_PCM_16) ;
  110. filesystem_full_test (SF_FORMAT_VOC | SF_FORMAT_PCM_16) ;
  111. permission_test ("readonly.voc", SF_FORMAT_VOC) ;
  112. test_count++ ;
  113. } ;
  114. if (do_all || ! strcmp (argv [1], "w64"))
  115. { zero_data_test ("zerolen.w64", SF_FORMAT_W64 | SF_FORMAT_PCM_16) ;
  116. filesystem_full_test (SF_FORMAT_W64 | SF_FORMAT_PCM_16) ;
  117. permission_test ("readonly.w64", SF_FORMAT_W64) ;
  118. test_count++ ;
  119. } ;
  120. if (do_all || ! strcmp (argv [1], "rf64"))
  121. { zero_data_test ("zerolen.rf64", SF_FORMAT_RF64 | SF_FORMAT_PCM_16) ;
  122. filesystem_full_test (SF_FORMAT_RF64 | SF_FORMAT_PCM_16) ;
  123. permission_test ("readonly.rf64", SF_FORMAT_RF64) ;
  124. rf64_downgrade_test ("downgrade.wav") ;
  125. /* Disable this by default, because it needs to write 4 gigabytes of data. */
  126. if (SF_FALSE)
  127. rf64_long_file_downgrade_test ("no-downgrade.rf64") ;
  128. test_count++ ;
  129. } ;
  130. if (do_all || ! strcmp (argv [1], "mat4"))
  131. { zero_data_test ("zerolen.mat4", SF_FORMAT_MAT4 | SF_FORMAT_PCM_16) ;
  132. filesystem_full_test (SF_FORMAT_MAT4 | SF_FORMAT_PCM_16) ;
  133. permission_test ("readonly.mat4", SF_FORMAT_MAT4) ;
  134. test_count++ ;
  135. } ;
  136. if (do_all || ! strcmp (argv [1], "mat5"))
  137. { zero_data_test ("zerolen.mat5", SF_FORMAT_MAT5 | SF_FORMAT_PCM_16) ;
  138. filesystem_full_test (SF_FORMAT_MAT5 | SF_FORMAT_PCM_16) ;
  139. permission_test ("readonly.mat5", SF_FORMAT_MAT5) ;
  140. test_count++ ;
  141. } ;
  142. if (do_all || ! strcmp (argv [1], "pvf"))
  143. { zero_data_test ("zerolen.pvf", SF_FORMAT_PVF | SF_FORMAT_PCM_16) ;
  144. filesystem_full_test (SF_FORMAT_PVF | SF_FORMAT_PCM_16) ;
  145. permission_test ("readonly.pvf", SF_FORMAT_PVF) ;
  146. test_count++ ;
  147. } ;
  148. if (do_all || ! strcmp (argv [1], "htk"))
  149. { zero_data_test ("zerolen.htk", SF_FORMAT_HTK | SF_FORMAT_PCM_16) ;
  150. filesystem_full_test (SF_FORMAT_HTK | SF_FORMAT_PCM_16) ;
  151. permission_test ("readonly.htk", SF_FORMAT_HTK) ;
  152. test_count++ ;
  153. } ;
  154. if (do_all || ! strcmp (argv [1], "avr"))
  155. { zero_data_test ("zerolen.avr", SF_FORMAT_AVR | SF_FORMAT_PCM_16) ;
  156. filesystem_full_test (SF_FORMAT_AVR | SF_FORMAT_PCM_16) ;
  157. permission_test ("readonly.avr", SF_FORMAT_AVR) ;
  158. test_count++ ;
  159. } ;
  160. if (do_all || ! strcmp (argv [1], "sds"))
  161. { zero_data_test ("zerolen.sds", SF_FORMAT_SDS | SF_FORMAT_PCM_16) ;
  162. filesystem_full_test (SF_FORMAT_SDS | SF_FORMAT_PCM_16) ;
  163. permission_test ("readonly.sds", SF_FORMAT_SDS) ;
  164. test_count++ ;
  165. } ;
  166. if (do_all || ! strcmp (argv [1], "mpc2k"))
  167. { zero_data_test ("zerolen.mpc", SF_FORMAT_MPC2K | SF_FORMAT_PCM_16) ;
  168. filesystem_full_test (SF_FORMAT_MPC2K | SF_FORMAT_PCM_16) ;
  169. permission_test ("readonly.mpc", SF_FORMAT_MPC2K) ;
  170. test_count++ ;
  171. } ;
  172. if (do_all || ! strcmp (argv [1], "ogg"))
  173. { zero_data_test ("zerolen.oga", SF_FORMAT_OGG | SF_FORMAT_VORBIS) ;
  174. /*-filesystem_full_test (SF_FORMAT_OGG | SF_FORMAT_VORBIS) ;-*/
  175. permission_test ("readonly.oga", SF_FORMAT_OGG) ;
  176. test_count++ ;
  177. } ;
  178. if (test_count == 0)
  179. { printf ("Mono : ************************************\n") ;
  180. printf ("Mono : * No '%s' test defined.\n", argv [1]) ;
  181. printf ("Mono : ************************************\n") ;
  182. return 1 ;
  183. } ;
  184. return 0 ;
  185. } /* main */
  186. /*============================================================================================
  187. ** Here are the test functions.
  188. */
  189. static void
  190. zero_data_test (const char *filename, int format)
  191. { SNDFILE *file ;
  192. SF_INFO sfinfo ;
  193. switch (format & SF_FORMAT_TYPEMASK)
  194. { case SF_FORMAT_OGG :
  195. if (HAVE_EXTERNAL_XIPH_LIBS == 0)
  196. return ;
  197. break ;
  198. default :
  199. break ;
  200. } ;
  201. print_test_name ("zero_data_test", filename) ;
  202. sfinfo.samplerate = 44100 ;
  203. sfinfo.format = format ;
  204. sfinfo.channels = 1 ;
  205. sfinfo.frames = 0 ;
  206. file = test_open_file_or_die (filename, SFM_WRITE, &sfinfo, SF_TRUE, __LINE__) ;
  207. sf_close (file) ;
  208. memset (&sfinfo, 0, sizeof (sfinfo)) ;
  209. file = test_open_file_or_die (filename, SFM_READ, &sfinfo, SF_TRUE, __LINE__) ;
  210. sf_close (file) ;
  211. unlink (filename) ;
  212. puts ("ok") ;
  213. } /* zero_data_test */
  214. static void
  215. filesystem_full_test (int format)
  216. {
  217. #if (defined (WIN32) || defined (_WIN32))
  218. (void) format ;
  219. /* Can't run this test on Win32 so return. */
  220. return ;
  221. #else
  222. SNDFILE *file ;
  223. SF_INFO sfinfo ;
  224. struct stat buf ;
  225. const char *filename = "/dev/full", *errorstr ;
  226. /* Make sure errno is zero before doing anything else. */
  227. errno = 0 ;
  228. print_test_name ("filesystem_full_test", filename) ;
  229. if (stat (filename, &buf) != 0)
  230. { puts ("/dev/full missing") ;
  231. return ;
  232. } ;
  233. if (S_ISCHR (buf.st_mode) == 0 && S_ISBLK (buf.st_mode) == 0)
  234. { puts ("/dev/full is not a device file") ;
  235. return ;
  236. } ;
  237. sfinfo.samplerate = 44100 ;
  238. sfinfo.format = format ;
  239. sfinfo.channels = 1 ;
  240. sfinfo.frames = 0 ;
  241. if ((file = sf_open (filename, SFM_WRITE, &sfinfo)) != NULL)
  242. { printf ("\n\nLine %d : Error, file should not have openned.\n", __LINE__ - 1) ;
  243. exit (1) ;
  244. } ;
  245. errorstr = sf_strerror (file) ;
  246. if (strstr (errorstr, " space ") == NULL || strstr (errorstr, "device") == NULL)
  247. { printf ("\n\nLine %d : Error bad error string : %s.\n", __LINE__ - 1, errorstr) ;
  248. exit (1) ;
  249. } ;
  250. puts ("ok") ;
  251. #endif
  252. } /* filesystem_full_test */
  253. static void
  254. permission_test (const char *filename, int typemajor)
  255. {
  256. #if (OS_IS_WIN32)
  257. /* Avoid compiler warnings. */
  258. (void) filename ;
  259. (void) typemajor ;
  260. /* Can't run this test on Win32 so return. */
  261. return ;
  262. #else
  263. FILE *textfile ;
  264. SNDFILE *file ;
  265. SF_INFO sfinfo ;
  266. const char *errorstr ;
  267. /* Make sure errno is zero before doing anything else. */
  268. errno = 0 ;
  269. if (getuid () == 0)
  270. { /* If running as root bypass this test.
  271. ** Root is allowed to open a readonly file for write.
  272. */
  273. return ;
  274. } ;
  275. print_test_name ("permission_test", filename) ;
  276. if (access (filename, F_OK) == 0)
  277. { chmod (filename, S_IWUSR) ;
  278. unlink (filename) ;
  279. } ;
  280. if ((textfile = fopen (filename, "w")) == NULL)
  281. { printf ("\n\nLine %d : not able to open text file for write.\n", __LINE__) ;
  282. exit (1) ;
  283. } ;
  284. fprintf (textfile, "This is a read only file.\n") ;
  285. fclose (textfile) ;
  286. if (chmod (filename, S_IRUSR | S_IRGRP))
  287. { printf ("\n\nLine %d : chmod failed", __LINE__) ;
  288. fflush (stdout) ;
  289. perror ("") ;
  290. exit (1) ;
  291. } ;
  292. sfinfo.samplerate = 44100 ;
  293. sfinfo.format = (typemajor | SF_FORMAT_PCM_16) ;
  294. sfinfo.channels = 1 ;
  295. sfinfo.frames = 0 ;
  296. if ((file = sf_open (filename, SFM_WRITE, &sfinfo)) != NULL)
  297. { printf ("\n\nLine %d : Error, file should not have opened.\n", __LINE__ - 1) ;
  298. exit (1) ;
  299. } ;
  300. errorstr = sf_strerror (file) ;
  301. if (strstr (errorstr, "ermission denied") == NULL)
  302. { printf ("\n\nLine %d : Error bad error string : %s.\n", __LINE__ - 1, errorstr) ;
  303. exit (1) ;
  304. } ;
  305. if (chmod (filename, S_IWUSR | S_IWGRP))
  306. { printf ("\n\nLine %d : chmod failed", __LINE__) ;
  307. fflush (stdout) ;
  308. perror ("") ;
  309. exit (1) ;
  310. } ;
  311. unlink (filename) ;
  312. puts ("ok") ;
  313. #endif
  314. } /* permission_test */
  315. static void
  316. wavex_amb_test (const char *filename)
  317. { static short buffer [800] ;
  318. SNDFILE *file ;
  319. SF_INFO sfinfo ;
  320. sf_count_t frames ;
  321. print_test_name (__func__, filename) ;
  322. sfinfo.samplerate = 44100 ;
  323. sfinfo.format = SF_FORMAT_WAVEX | SF_FORMAT_PCM_16 ;
  324. sfinfo.channels = 4 ;
  325. frames = ARRAY_LEN (buffer) / sfinfo.channels ;
  326. file = test_open_file_or_die (filename, SFM_WRITE, &sfinfo, SF_TRUE, __LINE__) ;
  327. sf_command (file, SFC_WAVEX_SET_AMBISONIC, NULL, SF_AMBISONIC_B_FORMAT) ;
  328. test_writef_short_or_die (file, 0, buffer, frames, __LINE__) ;
  329. sf_close (file) ;
  330. memset (&sfinfo, 0, sizeof (sfinfo)) ;
  331. file = test_open_file_or_die (filename, SFM_READ, &sfinfo, SF_TRUE, __LINE__) ;
  332. exit_if_true (
  333. sf_command (file, SFC_WAVEX_GET_AMBISONIC, NULL, 0) != SF_AMBISONIC_B_FORMAT,
  334. "\n\nLine %d : Error, this file should be in Ambisonic B format.\n", __LINE__
  335. ) ;
  336. sf_close (file) ;
  337. unlink (filename) ;
  338. puts ("ok") ;
  339. } /* wavex_amb_test */
  340. static void
  341. rf64_downgrade_test (const char *filename)
  342. { static short output [BUFFER_LEN] ;
  343. static short input [BUFFER_LEN] ;
  344. SNDFILE *file ;
  345. SF_INFO sfinfo ;
  346. unsigned k ;
  347. print_test_name (__func__, filename) ;
  348. sf_info_clear (&sfinfo) ;
  349. sfinfo.samplerate = 44100 ;
  350. sfinfo.frames = ARRAY_LEN (output) ;
  351. sfinfo.channels = 1 ;
  352. sfinfo.format = SF_FORMAT_RF64 | SF_FORMAT_PCM_16 ;
  353. file = test_open_file_or_die (filename, SFM_WRITE, &sfinfo, SF_TRUE, __LINE__) ;
  354. exit_if_true (sf_command (file, SFC_RF64_AUTO_DOWNGRADE, NULL, SF_FALSE) != SF_FALSE, "\n\nLine %d: sf_command failed.\n", __LINE__) ;
  355. exit_if_true (sf_command (file, SFC_RF64_AUTO_DOWNGRADE, NULL, SF_TRUE) != SF_TRUE, "\n\nLine %d: sf_command failed.\n", __LINE__) ;
  356. test_write_short_or_die (file, 0, output, ARRAY_LEN (output), __LINE__) ;
  357. exit_if_true (sf_command (file, SFC_RF64_AUTO_DOWNGRADE, NULL, SF_FALSE) != SF_TRUE, "\n\nLine %d: sf_command failed.\n", __LINE__) ;
  358. exit_if_true (sf_command (file, SFC_RF64_AUTO_DOWNGRADE, NULL, SF_TRUE) != SF_TRUE, "\n\nLine %d: sf_command failed.\n", __LINE__) ;
  359. sf_close (file) ;
  360. memset (input, 0, sizeof (input)) ;
  361. sf_info_clear (&sfinfo) ;
  362. file = test_open_file_or_die (filename, SFM_READ, &sfinfo, SF_TRUE, __LINE__) ;
  363. exit_if_true (sfinfo.format != (SF_FORMAT_WAVEX | SF_FORMAT_PCM_16), "\n\nLine %d: RF64 to WAV downgrade failed.\n", __LINE__) ;
  364. exit_if_true (sfinfo.frames != ARRAY_LEN (output), "\n\nLine %d: Incorrect number of frames in file (too short). (%d should be %d)\n", __LINE__, (int) sfinfo.frames, (int) ARRAY_LEN (output)) ;
  365. exit_if_true (sfinfo.channels != 1, "\n\nLine %d: Incorrect number of channels in file.\n", __LINE__) ;
  366. check_log_buffer_or_die (file, __LINE__) ;
  367. test_read_short_or_die (file, 0, input, ARRAY_LEN (input), __LINE__) ;
  368. sf_close (file) ;
  369. for (k = 0 ; k < ARRAY_LEN (input) ; k++)
  370. exit_if_true (input [k] != output [k],
  371. "\n\nLine: %d: Error on input %d, expected %d, got %d\n", __LINE__, k, output [k], input [k]) ;
  372. puts ("ok") ;
  373. unlink (filename) ;
  374. return ;
  375. } /* rf64_downgrade_test */
  376. static void
  377. rf64_long_file_downgrade_test (const char *filename)
  378. { static int output [BUFFER_LEN] ;
  379. static int input [1] = { 0 } ;
  380. SNDFILE *file ;
  381. SF_INFO sfinfo ;
  382. sf_count_t output_frames = 0 ;
  383. print_test_name (__func__, filename) ;
  384. sf_info_clear (&sfinfo) ;
  385. memset (output, 0, sizeof (output)) ;
  386. output [0] = 0x1020304 ;
  387. sfinfo.samplerate = 44100 ;
  388. sfinfo.frames = ARRAY_LEN (output) ;
  389. sfinfo.channels = 1 ;
  390. sfinfo.format = SF_FORMAT_RF64 | SF_FORMAT_PCM_32 ;
  391. file = test_open_file_or_die (filename, SFM_WRITE, &sfinfo, SF_TRUE, __LINE__) ;
  392. exit_if_true (sf_command (file, SFC_RF64_AUTO_DOWNGRADE, NULL, SF_TRUE) != SF_TRUE, "\n\nLine %d: sf_command failed.\n", __LINE__) ;
  393. while (output_frames * sizeof (output [0]) < 0x100000000)
  394. { test_write_int_or_die (file, 0, output, ARRAY_LEN (output), __LINE__) ;
  395. output_frames += ARRAY_LEN (output) ;
  396. } ;
  397. sf_close (file) ;
  398. sf_info_clear (&sfinfo) ;
  399. file = test_open_file_or_die (filename, SFM_READ, &sfinfo, SF_TRUE, __LINE__) ;
  400. exit_if_true (sfinfo.format != (SF_FORMAT_RF64 | SF_FORMAT_PCM_32), "\n\nLine %d: RF64 to WAV downgrade should have failed.\n", __LINE__) ;
  401. exit_if_true (sfinfo.channels != 1, "\n\nLine %d: Incorrect number of channels in file.\n", __LINE__) ;
  402. exit_if_true (sfinfo.frames != output_frames, "\n\nLine %d: Incorrect number of frames in file (%d should be %d).\n", __LINE__, (int) sfinfo.frames, (int) output_frames) ;
  403. /* Check that the first sample read is the same as the first written. */
  404. test_read_int_or_die (file, 0, input, ARRAY_LEN (input), __LINE__) ;
  405. exit_if_true (input [0] != output [0], "\n\nLine %d: Bad first sample (0x%08x).\n", __LINE__, input [0]) ;
  406. check_log_buffer_or_die (file, __LINE__) ;
  407. sf_close (file) ;
  408. puts ("ok") ;
  409. unlink (filename) ;
  410. return ;
  411. } /* rf64_long_file_downgrade_test */