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:
@@ -313,6 +313,58 @@ static bool test_stream_decoder()
|
||||
|
||||
printf("\n+++ libFLAC++ unit test: FLAC::Decoder::Stream\n\n");
|
||||
|
||||
//
|
||||
// test new -> delete
|
||||
//
|
||||
printf("allocating decoder instance... ");
|
||||
decoder = new StreamDecoder();
|
||||
if(0 == decoder) {
|
||||
printf("FAILED, new returned NULL\n");
|
||||
return false;
|
||||
}
|
||||
printf("OK\n");
|
||||
|
||||
printf("testing is_valid()... ");
|
||||
if(!decoder->is_valid()) {
|
||||
printf("FAILED, returned false\n");
|
||||
return false;
|
||||
}
|
||||
printf("OK\n");
|
||||
|
||||
printf("freeing decoder instance... ");
|
||||
delete decoder;
|
||||
printf("OK\n");
|
||||
|
||||
//
|
||||
// test new -> init -> delete
|
||||
//
|
||||
printf("allocating decoder instance... ");
|
||||
decoder = new StreamDecoder();
|
||||
if(0 == decoder) {
|
||||
printf("FAILED, new returned NULL\n");
|
||||
return false;
|
||||
}
|
||||
printf("OK\n");
|
||||
|
||||
printf("testing is_valid()... ");
|
||||
if(!decoder->is_valid()) {
|
||||
printf("FAILED, returned false\n");
|
||||
return false;
|
||||
}
|
||||
printf("OK\n");
|
||||
|
||||
printf("testing init()... ");
|
||||
if(decoder->init() != ::FLAC__STREAM_DECODER_SEARCH_FOR_METADATA)
|
||||
return decoder->die();
|
||||
printf("OK\n");
|
||||
|
||||
printf("freeing decoder instance... ");
|
||||
delete decoder;
|
||||
printf("OK\n");
|
||||
|
||||
//
|
||||
// test normal usage
|
||||
//
|
||||
num_expected_ = 0;
|
||||
expected_metadata_sequence_[num_expected_++] = &streaminfo_;
|
||||
|
||||
@@ -940,6 +992,58 @@ static bool test_seekable_stream_decoder()
|
||||
|
||||
printf("\n+++ libFLAC++ unit test: FLAC::Decoder::SeekableStream\n\n");
|
||||
|
||||
//
|
||||
// test new -> delete
|
||||
//
|
||||
printf("allocating decoder instance... ");
|
||||
decoder = new SeekableStreamDecoder();
|
||||
if(0 == decoder) {
|
||||
printf("FAILED, new returned NULL\n");
|
||||
return false;
|
||||
}
|
||||
printf("OK\n");
|
||||
|
||||
printf("testing is_valid()... ");
|
||||
if(!decoder->is_valid()) {
|
||||
printf("FAILED, returned false\n");
|
||||
return false;
|
||||
}
|
||||
printf("OK\n");
|
||||
|
||||
printf("freeing decoder instance... ");
|
||||
delete decoder;
|
||||
printf("OK\n");
|
||||
|
||||
//
|
||||
// test new -> init -> delete
|
||||
//
|
||||
printf("allocating decoder instance... ");
|
||||
decoder = new SeekableStreamDecoder();
|
||||
if(0 == decoder) {
|
||||
printf("FAILED, new returned NULL\n");
|
||||
return false;
|
||||
}
|
||||
printf("OK\n");
|
||||
|
||||
printf("testing is_valid()... ");
|
||||
if(!decoder->is_valid()) {
|
||||
printf("FAILED, returned false\n");
|
||||
return false;
|
||||
}
|
||||
printf("OK\n");
|
||||
|
||||
printf("testing init()... ");
|
||||
if(decoder->init() != ::FLAC__SEEKABLE_STREAM_DECODER_OK)
|
||||
return decoder->die();
|
||||
printf("OK\n");
|
||||
|
||||
printf("freeing decoder instance... ");
|
||||
delete decoder;
|
||||
printf("OK\n");
|
||||
|
||||
//
|
||||
// test normal usage
|
||||
//
|
||||
num_expected_ = 0;
|
||||
expected_metadata_sequence_[num_expected_++] = &streaminfo_;
|
||||
|
||||
@@ -1520,6 +1624,58 @@ static bool test_file_decoder()
|
||||
|
||||
printf("\n+++ libFLAC++ unit test: FLAC::Decoder::File\n\n");
|
||||
|
||||
//
|
||||
// test new -> delete
|
||||
//
|
||||
printf("allocating decoder instance... ");
|
||||
decoder = new FileDecoder();
|
||||
if(0 == decoder) {
|
||||
printf("FAILED, new returned NULL\n");
|
||||
return false;
|
||||
}
|
||||
printf("OK\n");
|
||||
|
||||
printf("testing is_valid()... ");
|
||||
if(!decoder->is_valid()) {
|
||||
printf("FAILED, returned false\n");
|
||||
return false;
|
||||
}
|
||||
printf("OK\n");
|
||||
|
||||
printf("freeing decoder instance... ");
|
||||
delete decoder;
|
||||
printf("OK\n");
|
||||
|
||||
//
|
||||
// test new -> init -> delete
|
||||
//
|
||||
printf("allocating decoder instance... ");
|
||||
decoder = new FileDecoder();
|
||||
if(0 == decoder) {
|
||||
printf("FAILED, new returned NULL\n");
|
||||
return false;
|
||||
}
|
||||
printf("OK\n");
|
||||
|
||||
printf("testing is_valid()... ");
|
||||
if(!decoder->is_valid()) {
|
||||
printf("FAILED, returned false\n");
|
||||
return false;
|
||||
}
|
||||
printf("OK\n");
|
||||
|
||||
printf("testing init()... ");
|
||||
if(decoder->init() != ::FLAC__SEEKABLE_STREAM_DECODER_OK)
|
||||
return decoder->die();
|
||||
printf("OK\n");
|
||||
|
||||
printf("freeing decoder instance... ");
|
||||
delete decoder;
|
||||
printf("OK\n");
|
||||
|
||||
//
|
||||
// test normal usage
|
||||
//
|
||||
num_expected_ = 0;
|
||||
expected_metadata_sequence_[num_expected_++] = &streaminfo_;
|
||||
|
||||
|
||||
@@ -24,13 +24,11 @@ int main(int argc, char *argv[])
|
||||
{
|
||||
(void)argc, (void)argv;
|
||||
|
||||
/*@@@@
|
||||
if(!test_encoders())
|
||||
return 1;
|
||||
|
||||
if(!test_decoders())
|
||||
return 1;
|
||||
@@@@*/
|
||||
|
||||
if(!test_metadata())
|
||||
return 1;
|
||||
|
||||
@@ -237,7 +237,6 @@ void OurFileDecoder::metadata_callback(const ::FLAC__StreamMetadata *metadata)
|
||||
}
|
||||
else {
|
||||
if(*our_metadata_.blocks[mc_our_block_number_] != metadata) {
|
||||
//@@@@if(!::FLAC__metadata_object_is_equal(our_metadata_.blocks[mc_our_block_number_], metadata)) {
|
||||
(void)die_("metadata block mismatch");
|
||||
error_occurred_ = true;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user