tests/core: Update audio test to the new framework
Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
This commit is contained in:
parent
077c6bf0c8
commit
65fb3888b6
|
@ -29,7 +29,6 @@ env.UsePackage("taglib")
|
||||||
res += [ CoreTest("library", "library.cpp") ]
|
res += [ CoreTest("library", "library.cpp") ]
|
||||||
res += [ CoreTest("playlist", "playlist.cpp") ]
|
res += [ CoreTest("playlist", "playlist.cpp") ]
|
||||||
res += [ CoreTest("deck", "deck.cpp") ]
|
res += [ CoreTest("deck", "deck.cpp") ]
|
||||||
|
res += [ CoreTest("audio", "audio.cpp") ]
|
||||||
|
|
||||||
Return("res")
|
Return("res")
|
||||||
|
|
||||||
#test( "audio" )
|
|
||||||
|
|
|
@ -4,7 +4,7 @@
|
||||||
#include <core/audio.h>
|
#include <core/audio.h>
|
||||||
#include <core/library.h>
|
#include <core/library.h>
|
||||||
#include <core/tags/tags.h>
|
#include <core/tags/tags.h>
|
||||||
#include <tests/test.h>
|
#include "test.h"
|
||||||
|
|
||||||
Track *TRACK_NULL = NULL;
|
Track *TRACK_NULL = NULL;
|
||||||
|
|
||||||
|
@ -35,7 +35,7 @@ public:
|
||||||
void seek_to(int64_t offset) { cur_pos = offset; }
|
void seek_to(int64_t offset) { cur_pos = offset; }
|
||||||
int64_t position() { return cur_pos; }
|
int64_t position() { return cur_pos; }
|
||||||
int64_t duration() { return cur_duration; }
|
int64_t duration() { return cur_duration; }
|
||||||
};
|
} driver;
|
||||||
|
|
||||||
|
|
||||||
void test_pre_init()
|
void test_pre_init()
|
||||||
|
@ -76,7 +76,7 @@ void test_init()
|
||||||
{
|
{
|
||||||
Track *track;
|
Track *track;
|
||||||
|
|
||||||
test :: cp_data_dir();
|
test_cp_data_dir();
|
||||||
audio :: init();
|
audio :: init();
|
||||||
|
|
||||||
track = audio :: current_track();
|
track = audio :: current_track();
|
||||||
|
@ -183,13 +183,9 @@ void test_autopause()
|
||||||
test_equal(driver->is_playing(), false);
|
test_equal(driver->is_playing(), false);
|
||||||
}
|
}
|
||||||
|
|
||||||
int main(int argc, char **argv)
|
DECLARE_UNIT_TESTS(
|
||||||
{
|
UNIT_TEST("Test Audio Pre-Init", test_pre_init),
|
||||||
TestDriver driver;
|
UNIT_TEST("Test Audio Init", test_init),
|
||||||
test :: run("Test Audio Pre-Init", test_pre_init);
|
UNIT_TEST("Test Audio Playback Controls", test_playback_controls),
|
||||||
test :: run("Test Audio Init", test_init);
|
UNIT_TEST("Test Audio Automatic Pausing", test_autopause),
|
||||||
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;
|
|
||||||
}
|
|
||||||
|
|
Loading…
Reference in New Issue