Slight improvements to application metadata tests.
authorErik de Castro Lopo <erikd@mega-nerd.com>
Fri, 14 Mar 2014 23:45:40 +0000 (10:45 +1100)
committerErik de Castro Lopo <erikd@mega-nerd.com>
Fri, 14 Mar 2014 23:45:40 +0000 (10:45 +1100)
src/test_libFLAC/decoders.c
src/test_libs_common/metadata_utils.c

index 0c9acad..207b5b4 100644 (file)
@@ -281,9 +281,15 @@ static void stream_decoder_metadata_callback_(const FLAC__StreamDecoder *decoder
        if(dcd->error_occurred)
                return;
 
-       printf("%d... ", dcd->current_metadata_number);
+       if (metadata->type == FLAC__METADATA_TYPE_APPLICATION) {
+               printf ("%d ('%c%c%c%c')... ", dcd->current_metadata_number, metadata->data.application.id [0], metadata->data.application.id [1], metadata->data.application.id [2], metadata->data.application.id [3]);
+       }
+       else {
+               printf("%d... ", dcd->current_metadata_number);
+       }
        fflush(stdout);
 
+
        if(dcd->current_metadata_number >= num_expected_) {
                (void)die_("got more metadata blocks than expected");
                dcd->error_occurred = true;
index fdeb5df..01e3fe4 100644 (file)
@@ -487,14 +487,14 @@ void mutils__init_metadata_blocks(
        application1->is_last = false;
        application1->type = FLAC__METADATA_TYPE_APPLICATION;
        application1->length = 8;
-       memcpy(application1->data.application.id, "\xfe\xdc\xba\x98", 4);
+       memcpy(application1->data.application.id, "This", 4);
        application1->data.application.data = malloc_or_die_(4);
        memcpy(application1->data.application.data, "\xf0\xe1\xd2\xc3", 4);
 
        application2->is_last = false;
        application2->type = FLAC__METADATA_TYPE_APPLICATION;
        application2->length = 4;
-       memcpy(application2->data.application.id, "\x76\x54\x32\x10", 4);
+       memcpy(application2->data.application.id, "Here", 4);
        application2->data.application.data = 0;
 
        {