diff options
author | Xin LI <delphij@FreeBSD.org> | 2018-02-28 06:23:12 +0000 |
---|---|---|
committer | Xin LI <delphij@FreeBSD.org> | 2018-02-28 06:23:12 +0000 |
commit | d14ac12f8738acac881f20b4d6244cfc22c68ead (patch) | |
tree | 8888cc3c4a7235bf8abd28681330d20442bc3705 /tests/ntpd/ntp_prio_q.c | |
parent | 07ac48c3644021279e113d530764a231e27490a7 (diff) | |
download | src-vendor/ntp/4.2.8p11.tar.gz src-vendor/ntp/4.2.8p11.zip |
Vendor import of ntp-4.2.8p11.vendor/ntp/4.2.8p11
Diffstat (limited to 'tests/ntpd/ntp_prio_q.c')
-rw-r--r-- | tests/ntpd/ntp_prio_q.c | 40 |
1 files changed, 24 insertions, 16 deletions
diff --git a/tests/ntpd/ntp_prio_q.c b/tests/ntpd/ntp_prio_q.c index 4b27157a9fa5..7741af82f3ff 100644 --- a/tests/ntpd/ntp_prio_q.c +++ b/tests/ntpd/ntp_prio_q.c @@ -27,23 +27,25 @@ typedef struct Element } element; -int +static int/*BOOL*/ compare_elements(const void * e1, const void * e2) { - return ((element*)e1)->number < ((element*)e2)->number; + return ((const element*)e1)->number < ((const element*)e2)->number; } /* tests */ -void -test_AllocateDeallocateNode(void) { +extern void test_AllocateDeallocateNode(void); +void test_AllocateDeallocateNode(void) +{ element* e_ptr = debug_get_node(sizeof(element)); free_node(e_ptr); } -void -test_EmptyQueue(void) { +extern void test_EmptyQueue(void); +void test_EmptyQueue(void) +{ queue* q = create_queue(); TEST_ASSERT_NOT_NULL(q); @@ -56,8 +58,9 @@ test_EmptyQueue(void) { } -void -test_OneElementQueue(void) { +extern void test_OneElementQueue(void); +void test_OneElementQueue(void) +{ queue* q = create_queue(); TEST_ASSERT_NOT_NULL(q); @@ -84,8 +87,9 @@ test_OneElementQueue(void) { } -void -test_MultipleElementQueue(void) { +extern void test_MultipleElementQueue(void); +void test_MultipleElementQueue(void) +{ queue* q = create_queue(); TEST_ASSERT_NOT_NULL(q); @@ -122,8 +126,9 @@ test_MultipleElementQueue(void) { } -void -test_CustomOrderQueue(void) { +extern void test_CustomOrderQueue(void); +void test_CustomOrderQueue(void) +{ queue* q = debug_create_priority_queue(compare_elements); element *e1_ptr, *e2_ptr, *e3_ptr, *e4_ptr, *e5_ptr, *e6_ptr; @@ -179,8 +184,9 @@ test_CustomOrderQueue(void) { } -void -test_DestroyNonEmptyQueue(void) { +extern void test_DestroyNonEmptyQueue(void); +void test_DestroyNonEmptyQueue(void) +{ queue* q = create_queue(); element *e1_ptr, *e2_ptr, *e3_ptr, *e4_ptr, *e5_ptr, *e6_ptr; @@ -201,8 +207,10 @@ test_DestroyNonEmptyQueue(void) { destroy_queue(q); } -void -test_AppendQueues(void) { + +extern void test_AppendQueues(void); +void test_AppendQueues(void) +{ queue* q1 = create_queue(); queue* q2 = create_queue(); queue* q3 = create_queue(); |