More streamlining of queue.
This commit is contained in:
parent
b61eb5a701
commit
df26c1cf4b
|
@ -19,6 +19,13 @@
|
|||
#ifndef QUEUE_H
|
||||
#define QUEUE_H
|
||||
#include "single_linked_list.h"
|
||||
/* Debug definitions. */
|
||||
#ifdef DEBUG
|
||||
#ifndef NDEBUG
|
||||
#define NDEBUG
|
||||
#endif /* NDEBUG. */
|
||||
#endif /* DEBUG. */
|
||||
#include <assert.h>
|
||||
|
||||
/* Constants. */
|
||||
/* Function error/return code on success. */
|
||||
|
|
|
@ -197,7 +197,6 @@ int test_queues() {
|
|||
/* Local variables. */
|
||||
queue_t *queue;
|
||||
node_t *node, *tail;
|
||||
int error;
|
||||
|
||||
/* Initialize an empty queue. */
|
||||
queue = initialize_queue();
|
||||
|
@ -217,7 +216,7 @@ int test_queues() {
|
|||
assert(queue->list->length == QUEUE_LENGTH_ONE);
|
||||
assert(queue->list->head && queue->list->head == node);
|
||||
assert(queue->tail && queue->tail == node);
|
||||
assert(get_node_i_single_linked_list(queue->list, 0, &error) == node);
|
||||
assert(get_node_i_single_linked_list(queue->list, 0) == node);
|
||||
assert(get_node_index_pointer_single_linked_list(queue->list, node) == 0);
|
||||
|
||||
/* Attempt to free the nodes and then the queue. */
|
||||
|
|
Loading…
Reference in New Issue