![]() |
Lumiera 0.pre.04
»edit your freedom«
|
C unit test to cover a probabilistic splay tree library implementation. More...
Go to the source code of this file.
C unit test to cover a probabilistic splay tree library implementation.
These tree data structures are used as key-value store in several of the management facilities of the vault
Definition in file test-psplay.c.
#include <time.h>#include <stdlib.h>#include <nobug.h>#include "lib/psplay.h"#include "lib/test/test.h"Classes | |
| struct | TestItem |
Functions | |
| TestItem | testitem_new (const char *str) |
| void | testitem_delete (TestItem self) |
| static int | cmp_fn (const void *, const void *) |
| static const void * | key_fn (const PSplaynode) |
| static void | delete_fn (PSplaynode) |
| static int | fcmp_fn (const void *, const void *) |
| static const void * | fkey_fn (const PSplaynode) |
| static void | fdelete_fn (PSplaynode) |
| psplay_delete_fn | testitem_print_node (PSplaynode node, const enum psplay_order_enum which, int level, void *data) |
| void | testitem_dump (PSplay self, FILE *dest) |
| psplay_delete_fn | testitem_graphvizprint_node (PSplaynode node, const enum psplay_order_enum which, int level, void *data) |
| void | testitem_graphvizdump (PSplay self, FILE *dest) |
| TESTS_BEGIN | TEST ("basic") |
| TEST ("basic_insert_dump") | |
| TEST ("insert_find") | |
| TEST ("basic_insert_splay") | |
| TEST ("basic_rand_insert_dump") | |
| TEST ("fast_insert") | |
| TEST ("nonexistant") | |
| TEST ("insert") | |
| TEST ("insert_rand") | |
| TEST ("insert_fastcheck") | |
| TestItem testitem_new | ( | const char * | str | ) |
Definition at line 37 of file test-psplay.c.
References psplaynode_init().
Referenced by TEST(), TEST(), TEST(), TEST(), and TEST().
Here is the call graph for this function:
Here is the caller graph for this function:| void testitem_delete | ( | TestItem | self | ) |
Definition at line 46 of file test-psplay.c.
Referenced by delete_fn(), and fdelete_fn().
Here is the caller graph for this function:
|
static |
|
static |
Definition at line 414 of file test-psplay.c.
References TestItem::key, and TestItem::node.
Referenced by TEST(), TEST(), TEST(), TEST(), and TEST().
Here is the caller graph for this function:
|
static |
Definition at line 423 of file test-psplay.c.
References TestItem::node, and testitem_delete().
Referenced by TEST(), TEST(), TEST(), TEST(), and TEST().
Here is the call graph for this function:
Here is the caller graph for this function:
|
static |
Definition at line 433 of file test-psplay.c.
Referenced by TEST().
Here is the caller graph for this function:
|
static |
Definition at line 439 of file test-psplay.c.
References TestItem::node.
Referenced by TEST().
Here is the caller graph for this function:
|
static |
Definition at line 445 of file test-psplay.c.
References TestItem::node, and testitem_delete().
Referenced by TEST().
Here is the call graph for this function:
Here is the caller graph for this function:| psplay_delete_fn testitem_print_node | ( | PSplaynode | node, |
| const enum psplay_order_enum | which, | ||
| int | level, | ||
| void * | data | ||
| ) |
Definition at line 80 of file test-psplay.c.
References TestItem::key, TestItem::node, PSPLAY_CONT, PSPLAY_INORDER, PSPLAY_POSTORDER, and PSPLAY_PREORDER.
Referenced by testitem_dump().
Here is the caller graph for this function:| void testitem_dump | ( | PSplay | self, |
| FILE * | dest | ||
| ) |
Definition at line 108 of file test-psplay.c.
References NULL, psplay_walk(), and testitem_print_node().
Here is the call graph for this function:| psplay_delete_fn testitem_graphvizprint_node | ( | PSplaynode | node, |
| const enum psplay_order_enum | which, | ||
| int | level, | ||
| void * | data | ||
| ) |
Definition at line 116 of file test-psplay.c.
References TestItem::key, TestItem::node, PSPLAY_CONT, PSPLAY_INORDER, PSPLAY_POSTORDER, and PSPLAY_PREORDER.
Referenced by testitem_graphvizdump().
Here is the caller graph for this function:| void testitem_graphvizdump | ( | PSplay | self, |
| FILE * | dest | ||
| ) |
Definition at line 148 of file test-psplay.c.
References NULL, psplay_walk(), and testitem_graphvizprint_node().
Referenced by TEST(), and TEST().
Here is the call graph for this function:
Here is the caller graph for this function:| TESTS_BEGIN TEST | ( | "basic" | ) |
Definition at line 174 of file test-psplay.c.
References cmp_fn(), delete_fn(), key_fn(), psplay_destroy(), psplay_dump(), and psplay_init().
Here is the call graph for this function:| TEST | ( | "basic_insert_dump" | ) |
Definition at line 185 of file test-psplay.c.
References cmp_fn(), delete_fn(), TestItem::key, key_fn(), psplay_destroy(), psplay_dump(), psplay_init(), psplay_insert(), psplay_remove_key(), and testitem_new().
Here is the call graph for this function:| TEST | ( | "insert_find" | ) |
Definition at line 227 of file test-psplay.c.
References cmp_fn(), delete_fn(), key_fn(), psplay_delete(), psplay_destroy(), psplay_dump(), psplay_find(), psplay_init(), psplay_insert(), psplay_remove(), testitem_graphvizdump(), and testitem_new().
Here is the call graph for this function:| TEST | ( | "basic_insert_splay" | ) |
Definition at line 289 of file test-psplay.c.
References cmp_fn(), delete_fn(), TestItem::key, key_fn(), psplay_destroy(), psplay_dump(), psplay_find(), psplay_init(), psplay_insert(), and testitem_new().
Here is the call graph for this function:| TEST | ( | "basic_rand_insert_dump" | ) |
Definition at line 318 of file test-psplay.c.
References cmp_fn(), delete_fn(), TestItem::key, key_fn(), psplay_destroy(), psplay_init(), psplay_insert(), testitem_graphvizdump(), and testitem_new().
Here is the call graph for this function:| TEST | ( | "fast_insert" | ) |
Definition at line 343 of file test-psplay.c.
References fcmp_fn(), fdelete_fn(), fkey_fn(), TestItem::key, psplay_destroy(), psplay_init(), psplay_insert(), and testitem_new().
Here is the call graph for this function:| TEST | ( | "nonexistant" | ) |
Definition at line 367 of file test-psplay.c.
| TEST | ( | "insert" | ) |
Definition at line 374 of file test-psplay.c.
| TEST | ( | "insert_rand" | ) |
Definition at line 382 of file test-psplay.c.
| TEST | ( | "insert_fastcheck" | ) |
Definition at line 390 of file test-psplay.c.