mirror of
https://gitee.com/openharmony/third_party_libsnd
synced 2024-11-23 09:59:54 +00:00
tests/command_test.c : Add test to detect if coding history is truncated.
This commit is contained in:
parent
e6aaad25d3
commit
0c1e963eda
@ -1,3 +1,8 @@
|
|||||||
|
2008-10-28 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
|
||||||
|
|
||||||
|
* tests/command_test.c
|
||||||
|
Add test to detect if coding history is truncated.
|
||||||
|
|
||||||
2008-10-27 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
|
2008-10-27 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
|
||||||
|
|
||||||
* tests/command_test.c
|
* tests/command_test.c
|
||||||
|
@ -990,7 +990,7 @@ check_coding_history_newlines (const char *filename)
|
|||||||
snprintf (bc_write.origination_date, sizeof (bc_write.origination_date), "%d/%02d/%02d", 2006, 3, 30) ;
|
snprintf (bc_write.origination_date, sizeof (bc_write.origination_date), "%d/%02d/%02d", 2006, 3, 30) ;
|
||||||
snprintf (bc_write.origination_time, sizeof (bc_write.origination_time), "%02d:%02d:%02d", 20, 27, 0) ;
|
snprintf (bc_write.origination_time, sizeof (bc_write.origination_time), "%02d:%02d:%02d", 20, 27, 0) ;
|
||||||
snprintf (bc_write.umid, sizeof (bc_write.umid), "Some umid") ;
|
snprintf (bc_write.umid, sizeof (bc_write.umid), "Some umid") ;
|
||||||
bc_write.coding_history_size = snprintf (bc_write.coding_history, sizeof (bc_write.coding_history), "This has\nUnix\nand\rMac OS9\rline endings.\n") ; ;
|
bc_write.coding_history_size = snprintf (bc_write.coding_history, sizeof (bc_write.coding_history), "This has\nUnix\nand\rMac OS9\rline endings.\nLast line") ; ;
|
||||||
|
|
||||||
file = test_open_file_or_die (filename, SFM_WRITE, &sfinfo, SF_TRUE, __LINE__) ;
|
file = test_open_file_or_die (filename, SFM_WRITE, &sfinfo, SF_TRUE, __LINE__) ;
|
||||||
if (sf_command (file, SFC_SET_BROADCAST_INFO, &bc_write, sizeof (bc_write)) == SF_FALSE)
|
if (sf_command (file, SFC_SET_BROADCAST_INFO, &bc_write, sizeof (bc_write)) == SF_FALSE)
|
||||||
@ -1016,6 +1016,11 @@ check_coding_history_newlines (const char *filename)
|
|||||||
exit (1) ;
|
exit (1) ;
|
||||||
} ;
|
} ;
|
||||||
|
|
||||||
|
if (strstr (bc_read.coding_history, "Last line") == NULL)
|
||||||
|
{ printf ("\n\nLine %d : coding history truncated.\n\n", __LINE__) ;
|
||||||
|
exit (1) ;
|
||||||
|
} ;
|
||||||
|
|
||||||
for (k = 1 ; k < bc_read.coding_history_size ; k++)
|
for (k = 1 ; k < bc_read.coding_history_size ; k++)
|
||||||
{ if (bc_read.coding_history [k] == '\n' && bc_read.coding_history [k - 1] != '\r')
|
{ if (bc_read.coding_history [k] == '\n' && bc_read.coding_history [k - 1] != '\r')
|
||||||
{ printf ("\n\nLine %d : '\\n' without '\\r' before.\n\n", __LINE__) ;
|
{ printf ("\n\nLine %d : '\\n' without '\\r' before.\n\n", __LINE__) ;
|
||||||
|
Loading…
Reference in New Issue
Block a user