tests/core: Update audio test to the new framework

Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
This commit is contained in:
Anna Schumaker 2015-08-31 08:20:11 -04:00
parent 077c6bf0c8
commit 65fb3888b6
2 changed files with 10 additions and 15 deletions

View File

@ -29,7 +29,6 @@ env.UsePackage("taglib")
res += [ CoreTest("library", "library.cpp") ]
res += [ CoreTest("playlist", "playlist.cpp") ]
res += [ CoreTest("deck", "deck.cpp") ]
res += [ CoreTest("audio", "audio.cpp") ]
Return("res")
#test( "audio" )

View File

@ -4,7 +4,7 @@
#include <core/audio.h>
#include <core/library.h>
#include <core/tags/tags.h>
#include <tests/test.h>
#include "test.h"
Track *TRACK_NULL = NULL;
@ -35,7 +35,7 @@ public:
void seek_to(int64_t offset) { cur_pos = offset; }
int64_t position() { return cur_pos; }
int64_t duration() { return cur_duration; }
};
} driver;
void test_pre_init()
@ -76,7 +76,7 @@ void test_init()
{
Track *track;
test :: cp_data_dir();
test_cp_data_dir();
audio :: init();
track = audio :: current_track();
@ -183,13 +183,9 @@ void test_autopause()
test_equal(driver->is_playing(), false);
}
int main(int argc, char **argv)
{
TestDriver driver;
test :: run("Test Audio Pre-Init", test_pre_init);
test :: run("Test Audio Init", test_init);
test :: run("Test Audio Playback Controls", test_playback_controls);
test :: run("Test Audio Track Controls", test_track_controls);
test :: run("Test Audio Automatic Pausing", test_autopause);
return 0;
}
DECLARE_UNIT_TESTS(
UNIT_TEST("Test Audio Pre-Init", test_pre_init),
UNIT_TEST("Test Audio Init", test_init),
UNIT_TEST("Test Audio Playback Controls", test_playback_controls),
UNIT_TEST("Test Audio Automatic Pausing", test_autopause),
);