mirror of
https://github.com/claunia/flac.git
synced 2025-12-16 18:54:26 +00:00
minor changes in anticipation of release
This commit is contained in:
@@ -58,17 +58,94 @@ FLAC__bool test_bitbuffer()
|
||||
|
||||
printf("\n+++ libFLAC unit test: bitbuffer\n\n");
|
||||
|
||||
printf("testing new... OK\n");
|
||||
/*
|
||||
* test new -> delete
|
||||
*/
|
||||
printf("testing new... ");
|
||||
bb = FLAC__bitbuffer_new();
|
||||
if(0 == bb) {
|
||||
printf("FAILED, returned NULL\n");
|
||||
return false;
|
||||
}
|
||||
printf("OK\n");
|
||||
|
||||
printf("testing delete... ");
|
||||
FLAC__bitbuffer_delete(bb);
|
||||
printf("OK\n");
|
||||
|
||||
/*
|
||||
* test new -> init -> delete
|
||||
*/
|
||||
printf("testing new... ");
|
||||
bb = FLAC__bitbuffer_new();
|
||||
if(0 == bb) {
|
||||
printf("FAILED, returned NULL\n");
|
||||
return false;
|
||||
}
|
||||
printf("OK\n");
|
||||
|
||||
printf("testing init... ");
|
||||
FLAC__bitbuffer_init(bb);
|
||||
if(0 == bb) {
|
||||
printf("FAILED, returned NULL\n");
|
||||
return false;
|
||||
}
|
||||
printf("OK\n");
|
||||
|
||||
printf("testing delete... ");
|
||||
FLAC__bitbuffer_delete(bb);
|
||||
printf("OK\n");
|
||||
|
||||
/*
|
||||
* test new -> init -> clear -> delete
|
||||
*/
|
||||
printf("testing new... ");
|
||||
bb = FLAC__bitbuffer_new();
|
||||
if(0 == bb) {
|
||||
printf("FAILED, returned NULL\n");
|
||||
return false;
|
||||
}
|
||||
printf("OK\n");
|
||||
|
||||
printf("testing init... ");
|
||||
FLAC__bitbuffer_init(bb);
|
||||
if(0 == bb) {
|
||||
printf("FAILED, returned NULL\n");
|
||||
return false;
|
||||
}
|
||||
printf("OK\n");
|
||||
|
||||
printf("testing clear... ");
|
||||
FLAC__bitbuffer_clear(bb);
|
||||
if(0 == bb) {
|
||||
printf("FAILED, returned NULL\n");
|
||||
return false;
|
||||
}
|
||||
printf("OK\n");
|
||||
|
||||
printf("testing delete... ");
|
||||
FLAC__bitbuffer_delete(bb);
|
||||
printf("OK\n");
|
||||
|
||||
/*
|
||||
* test normal usage
|
||||
*/
|
||||
printf("testing new... ");
|
||||
bb = FLAC__bitbuffer_new();
|
||||
bb_zero = FLAC__bitbuffer_new();
|
||||
bb_one = FLAC__bitbuffer_new();
|
||||
bbcopy = FLAC__bitbuffer_new();
|
||||
if(0 == bb || 0 == bb_zero || 0 == bb_one || 0 == bbcopy) {
|
||||
printf("FAILED, returned NULL\n");
|
||||
return false;
|
||||
}
|
||||
printf("OK\n");
|
||||
|
||||
printf("testing init... OK\n");
|
||||
FLAC__bitbuffer_init(bb);
|
||||
FLAC__bitbuffer_init(bb_zero);
|
||||
FLAC__bitbuffer_init(bb_one);
|
||||
FLAC__bitbuffer_init(bbcopy);
|
||||
printf("testing init... ");
|
||||
ok = FLAC__bitbuffer_init(bb) && FLAC__bitbuffer_init(bb_zero) && FLAC__bitbuffer_init(bb_one) && FLAC__bitbuffer_init(bbcopy);
|
||||
printf("%s\n", ok?"OK":"FAILED");
|
||||
if(!ok)
|
||||
return false;
|
||||
|
||||
printf("testing clear... ");
|
||||
ok = FLAC__bitbuffer_clear(bb) && FLAC__bitbuffer_clear(bb_zero) && FLAC__bitbuffer_clear(bb_one) && FLAC__bitbuffer_clear(bbcopy);
|
||||
|
||||
@@ -344,6 +344,35 @@ static FLAC__bool test_stream_decoder()
|
||||
|
||||
printf("\n+++ libFLAC unit test: FLAC__StreamDecoder\n\n");
|
||||
|
||||
printf("testing FLAC__stream_decoder_new()... ");
|
||||
decoder = FLAC__stream_decoder_new();
|
||||
if(0 == decoder) {
|
||||
printf("FAILED, returned NULL\n");
|
||||
return false;
|
||||
}
|
||||
printf("OK\n");
|
||||
|
||||
printf("testing FLAC__stream_decoder_delete()... ");
|
||||
FLAC__stream_decoder_delete(decoder);
|
||||
printf("OK\n");
|
||||
|
||||
printf("testing FLAC__stream_decoder_new()... ");
|
||||
decoder = FLAC__stream_decoder_new();
|
||||
if(0 == decoder) {
|
||||
printf("FAILED, returned NULL\n");
|
||||
return false;
|
||||
}
|
||||
printf("OK\n");
|
||||
|
||||
printf("testing FLAC__stream_decoder_init()... ");
|
||||
if(FLAC__stream_decoder_init(decoder) == FLAC__STREAM_DECODER_SEARCH_FOR_METADATA)
|
||||
return die_s_(0, decoder);
|
||||
printf("OK\n");
|
||||
|
||||
printf("testing FLAC__stream_decoder_delete()... ");
|
||||
FLAC__stream_decoder_delete(decoder);
|
||||
printf("OK\n");
|
||||
|
||||
num_expected_ = 0;
|
||||
expected_metadata_sequence_[num_expected_++] = &streaminfo_;
|
||||
|
||||
@@ -971,6 +1000,35 @@ static FLAC__bool test_seekable_stream_decoder()
|
||||
|
||||
printf("\n+++ libFLAC unit test: FLAC__SeekableStreamDecoder\n\n");
|
||||
|
||||
printf("testing FLAC__seekable_stream_decoder_new()... ");
|
||||
decoder = FLAC__seekable_stream_decoder_new();
|
||||
if(0 == decoder) {
|
||||
printf("FAILED, returned NULL\n");
|
||||
return false;
|
||||
}
|
||||
printf("OK\n");
|
||||
|
||||
printf("testing FLAC__seekable_stream_decoder_delete()... ");
|
||||
FLAC__seekable_stream_decoder_delete(decoder);
|
||||
printf("OK\n");
|
||||
|
||||
printf("testing FLAC__seekable_stream_decoder_new()... ");
|
||||
decoder = FLAC__seekable_stream_decoder_new();
|
||||
if(0 == decoder) {
|
||||
printf("FAILED, returned NULL\n");
|
||||
return false;
|
||||
}
|
||||
printf("OK\n");
|
||||
|
||||
printf("testing FLAC__seekable_stream_decoder_init()... ");
|
||||
if(FLAC__seekable_stream_decoder_init(decoder) == FLAC__SEEKABLE_STREAM_DECODER_OK)
|
||||
return die_ss_(0, decoder);
|
||||
printf("OK\n");
|
||||
|
||||
printf("testing FLAC__seekable_stream_decoder_delete()... ");
|
||||
FLAC__seekable_stream_decoder_delete(decoder);
|
||||
printf("OK\n");
|
||||
|
||||
num_expected_ = 0;
|
||||
expected_metadata_sequence_[num_expected_++] = &streaminfo_;
|
||||
|
||||
@@ -1517,6 +1575,35 @@ static FLAC__bool test_file_decoder()
|
||||
|
||||
printf("\n+++ libFLAC unit test: FLAC__FileDecoder\n\n");
|
||||
|
||||
printf("testing FLAC__file_decoder_new()... ");
|
||||
decoder = FLAC__file_decoder_new();
|
||||
if(0 == decoder) {
|
||||
printf("FAILED, returned NULL\n");
|
||||
return false;
|
||||
}
|
||||
printf("OK\n");
|
||||
|
||||
printf("testing FLAC__file_decoder_delete()... ");
|
||||
FLAC__file_decoder_delete(decoder);
|
||||
printf("OK\n");
|
||||
|
||||
printf("testing FLAC__file_decoder_new()... ");
|
||||
decoder = FLAC__file_decoder_new();
|
||||
if(0 == decoder) {
|
||||
printf("FAILED, returned NULL\n");
|
||||
return false;
|
||||
}
|
||||
printf("OK\n");
|
||||
|
||||
printf("testing FLAC__file_decoder_init()... ");
|
||||
if(FLAC__file_decoder_init(decoder) == FLAC__FILE_DECODER_OK)
|
||||
return die_f_(0, decoder);
|
||||
printf("OK\n");
|
||||
|
||||
printf("testing FLAC__file_decoder_delete()... ");
|
||||
FLAC__file_decoder_delete(decoder);
|
||||
printf("OK\n");
|
||||
|
||||
num_expected_ = 0;
|
||||
expected_metadata_sequence_[num_expected_++] = &streaminfo_;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user