queue: Move unit test up one directory
And modify it a bit to match my recent work. Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
This commit is contained in:
parent
4dafe7270f
commit
7332ed1e8f
|
@ -5,3 +5,4 @@ index
|
|||
filter
|
||||
idle
|
||||
tags
|
||||
queue
|
||||
|
|
|
@ -16,6 +16,7 @@ tests = [
|
|||
("filter.cpp", True, []),
|
||||
("idle.cpp", False, [ "idle.cpp" ]),
|
||||
("tags.cpp", True, []),
|
||||
("queue.cpp", True, [ "callback.cpp" ]),
|
||||
|
||||
]
|
||||
|
||||
|
|
|
@ -1,6 +0,0 @@
|
|||
#!/bin/bash
|
||||
# Copyright 2014 (c) Anna Schumaker.
|
||||
|
||||
. $(dirname $0)/_functions
|
||||
|
||||
./src/queue.run
|
|
@ -21,7 +21,6 @@ void test_default()
|
|||
{
|
||||
TestQueue q;
|
||||
|
||||
test :: new_test("Queue Default Constructor Test");
|
||||
test :: equal(q.get_cur(), (unsigned)-1);
|
||||
test :: equal(q.get_flags(), (unsigned)0);
|
||||
test :: equal(q.get_length(), (unsigned)0);
|
||||
|
@ -33,20 +32,17 @@ void test_constructor(unsigned int flags)
|
|||
{
|
||||
TestQueue q(flags | (1 << 30));
|
||||
|
||||
test :: new_test("Queue Constructor Test");
|
||||
test :: equal(q.get_cur(), (unsigned)-1);
|
||||
test :: equal(q.get_flags(), flags);
|
||||
test :: equal(q.get_length(), (unsigned)0);
|
||||
test :: equal(q.get_sorder().size(), (size_t)0);
|
||||
test :: equal(q.next(), (Track *)NULL);
|
||||
test :: end();
|
||||
}
|
||||
|
||||
void test_flags()
|
||||
{
|
||||
TestQueue q(0);
|
||||
|
||||
test :: new_test("Queue Flag Test");
|
||||
test :: equal(q.get_flags(), (unsigned)0);
|
||||
|
||||
q.set_flag(Q_ENABLED);
|
||||
|
@ -61,13 +57,12 @@ void test_flags()
|
|||
test :: equal(q.has_flag(Q_RANDOM), true);
|
||||
test :: equal(q.has_flag(Q_REPEAT), true);
|
||||
test :: equal(q.has_flag(Q_NO_SORT), false);
|
||||
test ::end();
|
||||
}
|
||||
|
||||
int main(int argc, char **argv)
|
||||
{
|
||||
test_default();
|
||||
test_constructor(Q_ENABLED | Q_RANDOM);
|
||||
test_flags();
|
||||
run_test("Queue Default Constructor Test", test_default);
|
||||
run_test("Queue Constructor Test", test_constructor, Q_ENABLED | Q_RANDOM);
|
||||
run_test("Queue Flag Test", test_flags);
|
||||
return 0;
|
||||
}
|
Loading…
Reference in New Issue