#include <sys/types.h>
#include <sys/time.h>
#include <sys/resource.h>
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#include <fcntl.h>
#include "op_sample_file.h"
#include "odb.h"
Go to the source code of this file.
Defines | |
#define | TEST_FILENAME "test-hash-db.dat" |
#define | verbprintf(args...) |
Functions | |
static double | used_time (void) |
static void | speed_test (int nr_item, char const *test_name) |
static void | do_speed_test (void) |
static int | test (int nr_item, int nr_unique_item) |
static void | do_test (void) |
static void | sanity_check (char const *filename) |
int | main (int argc, char *argv[1]) |
Variables | |
static int | nr_error |
static int | verbose = 0 |
Tests for DB hash
Definition in file db_test.c.
#define TEST_FILENAME "test-hash-db.dat" |
Definition at line 22 of file db_test.c.
Referenced by do_speed_test(), main(), speed_test(), and test().
#define verbprintf | ( | args... | ) |
static void do_speed_test | ( | void | ) | [static] |
Definition at line 75 of file db_test.c.
References speed_test(), and TEST_FILENAME.
Referenced by main().
static void do_test | ( | void | ) | [static] |
int main | ( | int | argc, | |
char * | argv[1] | |||
) |
Definition at line 163 of file db_test.c.
References do_speed_test(), do_test(), nr_error, sanity_check(), speed_test(), and TEST_FILENAME.
static void sanity_check | ( | char const * | filename | ) | [static] |
Definition at line 139 of file db_test.c.
References nr_error, odb_check_hash(), odb_close(), odb_hash_display_stat(), odb_hash_free_stat(), odb_hash_stat(), odb_open(), and ODB_RDONLY.
Referenced by main().
static void speed_test | ( | int | nr_item, | |
char const * | test_name | |||
) | [static] |
Definition at line 46 of file db_test.c.
References odb_close(), odb_open(), ODB_RDWR, odb_update_node(), TEST_FILENAME, used_time(), and verbprintf.
Referenced by do_speed_test(), and main().
static int test | ( | int | nr_item, | |
int | nr_unique_item | |||
) | [static] |
Definition at line 88 of file db_test.c.
References odb_check_hash(), odb_close(), odb_open(), ODB_RDWR, odb_update_node(), and TEST_FILENAME.
Referenced by do_test(), and main().
static double used_time | ( | void | ) | [static] |
Definition at line 34 of file db_test.c.
Referenced by speed_test().
int nr_error [static] |
Definition at line 24 of file db_test.c.
Referenced by do_test(), main(), and sanity_check().