Replace SDL_bool by bool in tests
Commit dfed1b250e
replaced SDL types by
standard types in sources, but tests were not updated.
This commit is contained in:
parent
3bc1c51b91
commit
08f506b24f
1 changed files with 11 additions and 11 deletions
|
@ -5,21 +5,21 @@
|
||||||
|
|
||||||
static void test_control_event_queue_empty(void) {
|
static void test_control_event_queue_empty(void) {
|
||||||
struct control_event_queue queue;
|
struct control_event_queue queue;
|
||||||
SDL_bool init_ok = control_event_queue_init(&queue);
|
bool init_ok = control_event_queue_init(&queue);
|
||||||
assert(init_ok);
|
assert(init_ok);
|
||||||
|
|
||||||
assert(control_event_queue_is_empty(&queue));
|
assert(control_event_queue_is_empty(&queue));
|
||||||
|
|
||||||
struct control_event dummy_event;
|
struct control_event dummy_event;
|
||||||
SDL_bool push_ok = control_event_queue_push(&queue, &dummy_event);
|
bool push_ok = control_event_queue_push(&queue, &dummy_event);
|
||||||
assert(push_ok);
|
assert(push_ok);
|
||||||
assert(!control_event_queue_is_empty(&queue));
|
assert(!control_event_queue_is_empty(&queue));
|
||||||
|
|
||||||
SDL_bool take_ok = control_event_queue_take(&queue, &dummy_event);
|
bool take_ok = control_event_queue_take(&queue, &dummy_event);
|
||||||
assert(take_ok);
|
assert(take_ok);
|
||||||
assert(control_event_queue_is_empty(&queue));
|
assert(control_event_queue_is_empty(&queue));
|
||||||
|
|
||||||
SDL_bool take_empty_ok = control_event_queue_take(&queue, &dummy_event);
|
bool take_empty_ok = control_event_queue_take(&queue, &dummy_event);
|
||||||
assert(!take_empty_ok); // the queue is empty
|
assert(!take_empty_ok); // the queue is empty
|
||||||
|
|
||||||
control_event_queue_destroy(&queue);
|
control_event_queue_destroy(&queue);
|
||||||
|
@ -27,7 +27,7 @@ static void test_control_event_queue_empty(void) {
|
||||||
|
|
||||||
static void test_control_event_queue_full(void) {
|
static void test_control_event_queue_full(void) {
|
||||||
struct control_event_queue queue;
|
struct control_event_queue queue;
|
||||||
SDL_bool init_ok = control_event_queue_init(&queue);
|
bool init_ok = control_event_queue_init(&queue);
|
||||||
assert(init_ok);
|
assert(init_ok);
|
||||||
|
|
||||||
assert(!control_event_queue_is_full(&queue));
|
assert(!control_event_queue_is_full(&queue));
|
||||||
|
@ -36,7 +36,7 @@ static void test_control_event_queue_full(void) {
|
||||||
// fill the queue
|
// fill the queue
|
||||||
while (control_event_queue_push(&queue, &dummy_event));
|
while (control_event_queue_push(&queue, &dummy_event));
|
||||||
|
|
||||||
SDL_bool take_ok = control_event_queue_take(&queue, &dummy_event);
|
bool take_ok = control_event_queue_take(&queue, &dummy_event);
|
||||||
assert(take_ok);
|
assert(take_ok);
|
||||||
assert(!control_event_queue_is_full(&queue));
|
assert(!control_event_queue_is_full(&queue));
|
||||||
|
|
||||||
|
@ -45,7 +45,7 @@ static void test_control_event_queue_full(void) {
|
||||||
|
|
||||||
static void test_control_event_queue_push_take(void) {
|
static void test_control_event_queue_push_take(void) {
|
||||||
struct control_event_queue queue;
|
struct control_event_queue queue;
|
||||||
SDL_bool init_ok = control_event_queue_init(&queue);
|
bool init_ok = control_event_queue_init(&queue);
|
||||||
assert(init_ok);
|
assert(init_ok);
|
||||||
|
|
||||||
struct control_event event = {
|
struct control_event event = {
|
||||||
|
@ -57,7 +57,7 @@ static void test_control_event_queue_push_take(void) {
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
SDL_bool push1_ok = control_event_queue_push(&queue, &event);
|
bool push1_ok = control_event_queue_push(&queue, &event);
|
||||||
assert(push1_ok);
|
assert(push1_ok);
|
||||||
|
|
||||||
event = (struct control_event) {
|
event = (struct control_event) {
|
||||||
|
@ -67,11 +67,11 @@ static void test_control_event_queue_push_take(void) {
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
SDL_bool push2_ok = control_event_queue_push(&queue, &event);
|
bool push2_ok = control_event_queue_push(&queue, &event);
|
||||||
assert(push2_ok);
|
assert(push2_ok);
|
||||||
|
|
||||||
// overwrite event
|
// overwrite event
|
||||||
SDL_bool take1_ok = control_event_queue_take(&queue, &event);
|
bool take1_ok = control_event_queue_take(&queue, &event);
|
||||||
assert(take1_ok);
|
assert(take1_ok);
|
||||||
assert(event.type == CONTROL_EVENT_TYPE_KEYCODE);
|
assert(event.type == CONTROL_EVENT_TYPE_KEYCODE);
|
||||||
assert(event.keycode_event.action == AKEY_EVENT_ACTION_DOWN);
|
assert(event.keycode_event.action == AKEY_EVENT_ACTION_DOWN);
|
||||||
|
@ -79,7 +79,7 @@ static void test_control_event_queue_push_take(void) {
|
||||||
assert(event.keycode_event.metastate == (AMETA_CTRL_LEFT_ON | AMETA_CTRL_ON));
|
assert(event.keycode_event.metastate == (AMETA_CTRL_LEFT_ON | AMETA_CTRL_ON));
|
||||||
|
|
||||||
// overwrite event
|
// overwrite event
|
||||||
SDL_bool take2_ok = control_event_queue_take(&queue, &event);
|
bool take2_ok = control_event_queue_take(&queue, &event);
|
||||||
assert(take2_ok);
|
assert(take2_ok);
|
||||||
assert(event.type == CONTROL_EVENT_TYPE_TEXT);
|
assert(event.type == CONTROL_EVENT_TYPE_TEXT);
|
||||||
assert(!strcmp(event.text_event.text, "abc"));
|
assert(!strcmp(event.text_event.text, "abc"));
|
||||||
|
|
Loading…
Reference in a new issue