Loading lib/mlm/file-tags.vala +2 −0 Original line number Diff line number Diff line Loading @@ -470,6 +470,8 @@ namespace MLM { private void define_track_total(int new_track, int new_total) { if (new_total < new_track && new_track > 0) new_total = new_track; if (new_total > 0 && new_track < 0) new_total = -1; string value = (new_track == -1) ? null : "%d/%d".printf(new_total, new_track); define_text_value(FrameId.TRACK, value); Loading test/test-file-tags.vala +15 −0 Original line number Diff line number Diff line Loading @@ -66,6 +66,7 @@ namespace MLM.Test { add_test("test_original", test_original); add_test("test_artist_picture", test_artist_picture); add_test("test_cover_picture", test_cover_picture); add_test("test_remove_tags", test_remove_tags); } /** Loading Loading @@ -519,5 +520,19 @@ namespace MLM.Test { test_artist_picture_file(empty_mp3, null, data1, data2); test_artist_picture_file(full_mp3, data1, data1, data2); } /** * Test for removing the tags of a {@link FileTags}. */ public void test_remove_tags() { var path = full_mp3.get_path(); var tags = new FileTags(path); GLib.assert(tags.has_tags); tags.remove_tags(); tags = null; tags = new FileTags(path); GLib.assert(!tags.has_tags); tags = null; } } } Loading
lib/mlm/file-tags.vala +2 −0 Original line number Diff line number Diff line Loading @@ -470,6 +470,8 @@ namespace MLM { private void define_track_total(int new_track, int new_total) { if (new_total < new_track && new_track > 0) new_total = new_track; if (new_total > 0 && new_track < 0) new_total = -1; string value = (new_track == -1) ? null : "%d/%d".printf(new_total, new_track); define_text_value(FrameId.TRACK, value); Loading
test/test-file-tags.vala +15 −0 Original line number Diff line number Diff line Loading @@ -66,6 +66,7 @@ namespace MLM.Test { add_test("test_original", test_original); add_test("test_artist_picture", test_artist_picture); add_test("test_cover_picture", test_cover_picture); add_test("test_remove_tags", test_remove_tags); } /** Loading Loading @@ -519,5 +520,19 @@ namespace MLM.Test { test_artist_picture_file(empty_mp3, null, data1, data2); test_artist_picture_file(full_mp3, data1, data1, data2); } /** * Test for removing the tags of a {@link FileTags}. */ public void test_remove_tags() { var path = full_mp3.get_path(); var tags = new FileTags(path); GLib.assert(tags.has_tags); tags.remove_tags(); tags = null; tags = new FileTags(path); GLib.assert(!tags.has_tags); tags = null; } } }