#include <inttypes.h>
#include <stdbool.h>
#include <stdio.h>
#include <stdlib.h>
static bool test_set_next() {
uint32_t value1 = 10;
uint32_t value2 = 20;
if (d1 == 20) {
if (d2 == 10) {
if (node1 != NULL || node2 != NULL) {
printf("Node incorrectly destroyed\n");
return false;
}
return true;
}
}
if (node1 != NULL || node2 != NULL) {
printf("Node incorrectly destroyed\n");
}
return false;
}
static bool test_set_previous() {
uint32_t value1 = 10;
uint32_t value2 = 20;
if (d1 == 20) {
if (d2 == 10) {
if (node1 != NULL || node2 != NULL) {
printf("Node incorrectly destroyed\n");
return false;
}
return true;
}
}
if (node1 != NULL || node2 != NULL) {
printf("Node incorrectly destroyed\n");
}
return false;
}
int main(
int argc,
char **argv) {
if (test_set_next()) {
if (test_set_previous()) {
return EXIT_SUCCESS;
}
}
return EXIT_FAILURE;
}
int main(int argc, char **argv)
Definition: gru_list_test.c:198
void gru_node_destroy(gru_node_t **node)
Destroys a node and sets is address to NULL.
Definition: gru_node.c:33
void gru_node_set_previous(gru_node_t *node, gru_node_t *previous)
Definition: gru_node.c:40
gru_node_t * gru_node_new(const void *ptr)
Creates a new node.
Definition: gru_node.c:18
void gru_node_set_next(gru_node_t *node, gru_node_t *next)
Definition: gru_node.c:52
#define gru_node_get_data(type, node)
Definition: gru_node.h:73
Definition: gru_node.h:25
struct gru_node_t_ * next
Definition: gru_node.h:26
struct gru_node_t_ * previous
Definition: gru_node.h:27