2015-12-12 09:04:25 -05:00
|
|
|
/*
|
|
|
|
* Copyright 2015 (c) Anna Schumaker.
|
|
|
|
*/
|
|
|
|
#include <core/history.h>
|
|
|
|
#include <tests/test.h>
|
|
|
|
|
|
|
|
static void test_init()
|
|
|
|
{
|
|
|
|
struct queue *q = history_get_queue();
|
|
|
|
|
2015-12-12 09:18:26 -05:00
|
|
|
history_init(NULL);
|
|
|
|
|
2015-12-12 09:04:25 -05:00
|
|
|
test_not_equal((void *)q, NULL);
|
2015-12-12 09:18:26 -05:00
|
|
|
test_equal(queue_has_flag(q, Q_ENABLED), (bool)true);
|
|
|
|
test_equal(queue_has_flag(q, Q_REPEAT), (bool)true);
|
|
|
|
test_equal(queue_has_flag(q, Q_NO_SORT), (bool)true);
|
|
|
|
test_equal(queue_has_flag(q, Q_ADD_FRONT), (bool)true);
|
|
|
|
test_equal(queue_has_flag(q, Q_SAVE_SORT), (bool)false);
|
|
|
|
test_equal(queue_has_flag(q, Q_SAVE_FLAGS), (bool)false);
|
|
|
|
test_equal((void *)q->q_sort, NULL);
|
|
|
|
test_equal(queue_size(q), 0);
|
|
|
|
|
|
|
|
history_deinit();
|
2015-12-12 09:04:25 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
DECLARE_UNIT_TESTS(
|
|
|
|
UNIT_TEST("History Initialization", test_init),
|
|
|
|
);
|