Skip to content

Commit

Permalink
More tests for FileUtils.count_music_file, a bug discovered (sudirect…
Browse files Browse the repository at this point in the history
…ory searching does not update music file count) and fixed
  • Loading branch information
xapantu committed Jul 21, 2014
1 parent 899d9fa commit 5fc6483
Show file tree
Hide file tree
Showing 6 changed files with 4 additions and 1 deletion.
2 changes: 1 addition & 1 deletion core/Utils/FileUtils.vala
Original file line number Diff line number Diff line change
Expand Up @@ -207,7 +207,7 @@ namespace Noise.FileUtils {
files.add (file.get_uri ());
}
else if(file_info.get_file_type() == FileType.DIRECTORY) {
count_music_files (file, files);
index += count_music_files (file, files);
}
}
}
Expand Down
3 changes: 3 additions & 0 deletions core/tests/Tests.vala
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,9 @@ void add_file_utils_tests () {
Test.add_func ("/FileUtils/is_valid_content_type", () => {
assert (Noise.FileUtils.count_music_files (File.new_for_path ("../tests/data/count_music_files/"),
new Gee.ArrayList<string>()) == 3);

assert (Noise.FileUtils.count_music_files (File.new_for_path ("../tests/data/count_music_files_subdir/"),
new Gee.ArrayList<string>()) == 4);
});

Test.add_func ("/FileUtils/count_music_files", () => {
Expand Down
Binary file added tests/data/count_music_files_subdir/file1.mp3
Binary file not shown.
Binary file added tests/data/count_music_files_subdir/file1.ogg
Binary file not shown.
Binary file added tests/data/count_music_files_subdir/file1.wav
Binary file not shown.
Binary file added tests/data/count_music_files_subdir/sub/file1.mp3
Binary file not shown.

0 comments on commit 5fc6483

Please sign in to comment.