add some more missing unit tests
authorJosh Coalson <jcoalson@users.sourceforce.net>
Wed, 15 Jan 2003 03:16:12 +0000 (03:16 +0000)
committerJosh Coalson <jcoalson@users.sourceforce.net>
Wed, 15 Jan 2003 03:16:12 +0000 (03:16 +0000)
src/test_libFLAC/metadata_object.c

index 144440f..2adcd22 100644 (file)
@@ -1244,6 +1244,16 @@ FLAC__bool test_metadata_object()
                return false;
        printf("OK\n");
 
+       printf("testing FLAC__metadata_object_cuesheet_insert_blank_track() on end of non-empty array...");
+       cs_insert_new_(&track, cuesheet, 4, 0, 0, "\0\0\0\0\0\0\0\0\0\0\0\0", false, false);
+       if(!FLAC__metadata_object_cuesheet_insert_blank_track(block, 4)) {
+               printf("FAILED, returned false\n");
+               return false;
+       }
+       if(!mutils__compare_block(cuesheet, block))
+               return false;
+       printf("OK\n");
+
        printf("testing FLAC__metadata_object_clone()... ");
        blockcopy = FLAC__metadata_object_clone(block);
        if(0 == blockcopy) {
@@ -1258,6 +1268,16 @@ FLAC__bool test_metadata_object()
        FLAC__metadata_object_delete(blockcopy);
        printf("OK\n");
 
+       printf("testing FLAC__metadata_object_cuesheet_delete_track() on end of array...");
+       cs_delete_(cuesheet, 4);
+       if(!FLAC__metadata_object_cuesheet_delete_track(block, 4)) {
+               printf("FAILED, returned false\n");
+               return false;
+       }
+       if(!mutils__compare_block(cuesheet, block))
+               return false;
+       printf("OK\n");
+
        printf("testing FLAC__metadata_object_cuesheet_delete_track() on middle of array...");
        cs_delete_(cuesheet, 2);
        if(!FLAC__metadata_object_cuesheet_delete_track(block, 2)) {
@@ -1373,6 +1393,18 @@ FLAC__bool test_metadata_object()
                return false;
        printf("OK\n");
 
+       index.offset = 0;
+       index.number = 0;
+       printf("testing FLAC__metadata_object_cuesheet_track_insert_blank_index() on end of non-empty array...");
+       tr_insert_new_(cuesheet, 0, 4, index);
+       if(!FLAC__metadata_object_cuesheet_track_insert_blank_index(block, 0, 4)) {
+               printf("FAILED, returned false\n");
+               return false;
+       }
+       if(!mutils__compare_block(cuesheet, block))
+               return false;
+       printf("OK\n");
+
        printf("testing FLAC__metadata_object_clone()... ");
        blockcopy = FLAC__metadata_object_clone(block);
        if(0 == blockcopy) {
@@ -1387,6 +1419,16 @@ FLAC__bool test_metadata_object()
        FLAC__metadata_object_delete(blockcopy);
        printf("OK\n");
 
+       printf("testing FLAC__metadata_object_cuesheet_track_delete_index() on end of array...");
+       tr_delete_(cuesheet, 0, 4);
+       if(!FLAC__metadata_object_cuesheet_track_delete_index(block, 0, 4)) {
+               printf("FAILED, returned false\n");
+               return false;
+       }
+       if(!mutils__compare_block(cuesheet, block))
+               return false;
+       printf("OK\n");
+
        printf("testing FLAC__metadata_object_cuesheet_track_delete_index() on middle of array...");
        tr_delete_(cuesheet, 0, 2);
        if(!FLAC__metadata_object_cuesheet_track_delete_index(block, 0, 2)) {