Go to the source code of this file.
Defines | |
#define | FAILIF(cond) do {} while ((cond) && fatal(__func__, __LINE__)) |
#define | CHKSYS(res) FAILIF((res) == -1) |
#define | CHKPTR(p) FAILIF((p) == NULL) |
Functions | |
static int | fatal (const char *fn, int lineno) |
static int | test_directory_creation (void) |
Use standard mkdtemp() to create a subdirectory of the current working directory, and set the TEST_DIRECTORY environment variable with its name. | |
static int | test_btree_io (void) |
Basic tests of ccn_btree_io_from_directory() and its methods. | |
static void | check_structure_size (const char *what, int sz) |
Helper for test_structure_sizes(). | |
int | test_structure_sizes (void) |
Helper for test_structure_sizes(). | |
int | test_btree_lockfile (void) |
Test that the lockfile works. | |
int | test_btree_chknode (void) |
int | test_btree_key_fetch (void) |
int | test_btree_compare (void) |
int | test_btree_searchnode (void) |
int | test_btree_init (void) |
struct ccn_btree * | example_btree_small (void) |
int | test_btree_lookup (void) |
int | test_basic_btree_insert_entry (void) |
int | test_btree_inserts_from_stdin (void) |
int | test_flatname (void) |
static int | testhelp_count_matches (struct ccn_btree *btree, unsigned char *msg, size_t size) |
Given an Interest (or a Name), find the matching objects. | |
int | test_insert_content (void) |
Make an index from a file filled ccnb-encoded content objects. | |
int | ccnbtreetest_main (int argc, char **argv) |
Variables | |
struct node_example | ex1 |
struct node_example | ex2 |
struct root_example | rootex1 |
Definition in file ccnbtreetest.c.
#define CHKPTR | ( | p | ) | FAILIF((p) == NULL) |
Definition at line 43 of file ccnbtreetest.c.
Referenced by example_btree_small(), r_store_content_from_accession(), r_store_init(), r_store_look(), test_basic_btree_insert_entry(), test_btree_chknode(), test_btree_compare(), test_btree_init(), test_btree_inserts_from_stdin(), test_btree_io(), test_btree_key_fetch(), test_btree_lockfile(), test_btree_lookup(), test_btree_searchnode(), test_directory_creation(), test_insert_content(), and testhelp_count_matches().
#define CHKSYS | ( | res | ) | FAILIF((res) == -1) |
Definition at line 42 of file ccnbtreetest.c.
Referenced by ccnbtreetest_main(), example_btree_small(), r_store_init(), test_basic_btree_insert_entry(), test_btree_chknode(), test_btree_inserts_from_stdin(), test_btree_io(), test_btree_key_fetch(), test_btree_lockfile(), test_directory_creation(), test_insert_content(), and testhelp_count_matches().
#define FAILIF | ( | cond | ) | do {} while ((cond) && fatal(__func__, __LINE__)) |
Definition at line 41 of file ccnbtreetest.c.
Referenced by check_structure_size(), r_store_init(), test_basic_btree_insert_entry(), test_btree_chknode(), test_btree_compare(), test_btree_init(), test_btree_inserts_from_stdin(), test_btree_io(), test_btree_key_fetch(), test_btree_lockfile(), test_btree_lookup(), test_btree_searchnode(), test_flatname(), test_insert_content(), and testhelp_count_matches().
int ccnbtreetest_main | ( | int | argc, | |
char ** | argv | |||
) |
Definition at line 917 of file ccnbtreetest.c.
static void check_structure_size | ( | const char * | what, | |
int | sz | |||
) | [static] |
Helper for test_structure_sizes().
Prints out the size of the struct
Definition at line 147 of file ccnbtreetest.c.
Referenced by test_structure_sizes().
struct ccn_btree* example_btree_small | ( | void | ) | [read] |
Definition at line 422 of file ccnbtreetest.c.
Referenced by test_basic_btree_insert_entry(), and test_btree_lookup().
static int fatal | ( | const char * | fn, | |
int | lineno | |||
) | [static] |
Definition at line 46 of file ccnbtreetest.c.
int test_basic_btree_insert_entry | ( | void | ) |
int test_btree_chknode | ( | void | ) |
int test_btree_compare | ( | void | ) |
int test_btree_init | ( | void | ) |
int test_btree_inserts_from_stdin | ( | void | ) |
static int test_btree_io | ( | void | ) | [static] |
Basic tests of ccn_btree_io_from_directory() and its methods.
Assumes TEST_DIRECTORY has been set.
Definition at line 89 of file ccnbtreetest.c.
Referenced by ccnbtreetest_main().
int test_btree_key_fetch | ( | void | ) |
int test_btree_lockfile | ( | void | ) |
Test that the lockfile works.
Definition at line 176 of file ccnbtreetest.c.
Referenced by ccnbtreetest_main().
int test_btree_lookup | ( | void | ) |
int test_btree_searchnode | ( | void | ) |
static int test_directory_creation | ( | void | ) | [static] |
Use standard mkdtemp() to create a subdirectory of the current working directory, and set the TEST_DIRECTORY environment variable with its name.
Definition at line 61 of file ccnbtreetest.c.
Referenced by ccnbtreetest_main().
int test_flatname | ( | void | ) |
int test_insert_content | ( | void | ) |
Make an index from a file filled ccnb-encoded content objects.
Intersprsed interests will be regarded as querys, and matches will be found.
The file is named by the environment varible TEST_CONTENT.
Definition at line 798 of file ccnbtreetest.c.
Referenced by ccnbtreetest_main().
int test_structure_sizes | ( | void | ) |
Helper for test_structure_sizes().
Prints the size of important structures, and make sure that they are mutiples of CCN_BT_SIZE_UNITS.
Definition at line 161 of file ccnbtreetest.c.
Referenced by ccnbtreetest_main().
static int testhelp_count_matches | ( | struct ccn_btree * | btree, | |
unsigned char * | msg, | |||
size_t | size | |||
) | [static] |
Given an Interest (or a Name), find the matching objects.
Definition at line 728 of file ccnbtreetest.c.
Referenced by test_insert_content().
struct node_example ex1 |
Referenced by example_btree_small(), test_btree_chknode(), test_btree_compare(), test_btree_key_fetch(), and test_btree_searchnode().
struct node_example ex2 |
Initial value:
{
{{0x05, 0x3a, 0xde, 0x78}, {1}},
"struthiomimus",
{
{.t={.koff1={0,0,0,2+8}, .ksiz1={0,3}, .entdx={0,0}, .entsz={3}}},
{.t={.koff0={0,0,0,0+8}, .ksiz0={0,5}, .entdx={0,1}, .entsz={3}}},
{.t={.koff0={0,0,0,1+8}, .ksiz0={0,5}, .entdx={0,2}, .entsz={3}}},
}
}
Definition at line 216 of file ccnbtreetest.c.
struct root_example rootex1 |
Referenced by example_btree_small().