48 lines
1.3 KiB
C++
48 lines
1.3 KiB
C++
/**
|
|
* @file
|
|
* Copyright 2014 (c) Anna Schumaker.
|
|
*/
|
|
#include <core/tags/track.h>
|
|
#include <tests/test.h>
|
|
|
|
static void test_track_tag_default()
|
|
{
|
|
Track track;
|
|
|
|
test_equal(track.library(), (Library *)NULL);
|
|
test_equal(track.artist, (Artist *)NULL);
|
|
test_equal(track.album, (Album *)NULL);
|
|
test_equal(track.genre, (Genre *)NULL);
|
|
|
|
test_equal(track.name(), (std::string)"");
|
|
test_equal(track.lowercase(), (std::string)"");
|
|
test_equal(track.primary_key(), (std::string)"");
|
|
test_equal(track.title, (std::string)"");
|
|
test_equal(track.title_lower, (std::string)"");
|
|
test_equal(track.filepath, (std::string)"");
|
|
test_equal(track.length_str, (std::string)"");
|
|
|
|
test_equal(track.track, (unsigned)0);
|
|
test_equal(track.length, (unsigned)0);
|
|
test_equal(track.play_count, (unsigned)0);
|
|
test_equal(track.last_year, (unsigned)0);
|
|
test_equal(track.last_month, (unsigned)0);
|
|
test_equal(track.last_day, (unsigned)0);
|
|
}
|
|
|
|
static void test_track_tag_constructor()
|
|
{
|
|
Library *library = tags :: get_library("/home/Zelda/Music");
|
|
Track track(library);
|
|
|
|
test_equal(track.library(), library);
|
|
test_equal(track.library()->size(), (unsigned)1);
|
|
}
|
|
|
|
int main(int argc, char **argv)
|
|
{
|
|
run_test("Track Tag Default Constructor Test", test_track_tag_default);
|
|
run_test("Track Tag Constructor Test", test_track_tag_constructor);
|
|
return 0;
|
|
}
|