PostgreSQL Source Code
git master
|
#include "postgres.h"
#include "common/int.h"
#include "common/pg_prng.h"
#include "fmgr.h"
#include "miscadmin.h"
#include "storage/lwlock.h"
#include "utils/memutils.h"
#include "utils/timestamp.h"
#include "lib/radixtree.h"
Go to the source code of this file.
Data Structures | |
struct | rt_node_class_test_elem |
Macros | |
#define | UINT64_HEX_FORMAT "%" INT64_MODIFIER "X" |
#define | EXPECT_TRUE(expr) |
#define | EXPECT_FALSE(expr) |
#define | EXPECT_EQ_U64(result_expr, expected_expr) |
#define | RT_PREFIX rt |
#define | RT_SCOPE |
#define | RT_DECLARE |
#define | RT_DEFINE |
#define | RT_USE_DELETE |
#define | RT_VALUE_TYPE TestValueType |
#define | RT_DEBUG |
Typedefs | |
typedef uint64 | TestValueType |
typedef struct rt_node_class_test_elem | rt_node_class_test_elem |
Functions | |
static uint64 | rt_num_entries (rt_radix_tree *tree) |
PG_FUNCTION_INFO_V1 (test_radixtree) | |
static void | test_empty (void) |
static void | test_basic (rt_node_class_test_elem *test_info, int shift, bool asc) |
static int | key_cmp (const void *a, const void *b) |
static void | test_random (void) |
Datum | test_radixtree (PG_FUNCTION_ARGS) |
Variables | |
static rt_node_class_test_elem | rt_node_class_tests [] |
PG_MODULE_MAGIC | |
#define EXPECT_EQ_U64 | ( | result_expr, | |
expected_expr | |||
) |
Definition at line 45 of file test_radixtree.c.
#define EXPECT_FALSE | ( | expr | ) |
Definition at line 37 of file test_radixtree.c.
#define EXPECT_TRUE | ( | expr | ) |
Definition at line 29 of file test_radixtree.c.
#define RT_DEBUG |
Definition at line 107 of file test_radixtree.c.
#define RT_DECLARE |
Definition at line 100 of file test_radixtree.c.
#define RT_DEFINE |
Definition at line 101 of file test_radixtree.c.
#define RT_PREFIX rt |
Definition at line 98 of file test_radixtree.c.
#define RT_SCOPE |
Definition at line 99 of file test_radixtree.c.
#define RT_USE_DELETE |
Definition at line 102 of file test_radixtree.c.
#define RT_VALUE_TYPE TestValueType |
Definition at line 103 of file test_radixtree.c.
#define UINT64_HEX_FORMAT "%" INT64_MODIFIER "X" |
Definition at line 26 of file test_radixtree.c.
typedef struct rt_node_class_test_elem rt_node_class_test_elem |
typedef uint64 TestValueType |
Definition at line 60 of file test_radixtree.c.
|
static |
Definition at line 299 of file test_radixtree.c.
References a, b, and pg_cmp_u64().
Referenced by test_random().
PG_FUNCTION_INFO_V1 | ( | test_radixtree | ) |
|
static |
Definition at line 115 of file test_radixtree.c.
References tree.
Referenced by test_empty(), and test_random().
|
static |
Definition at line 170 of file test_radixtree.c.
References ALLOCSET_SMALL_SIZES, AllocSetContextCreate, rt_node_class_test_elem::class_name, CurrentMemoryContext, dsa_create, dsa_detach(), elog, EXPECT_EQ_U64, EXPECT_FALSE, EXPECT_TRUE, i, LWLockNewTrancheId(), LWLockRegisterTranche(), rt_node_class_test_elem::nkeys, NOTICE, palloc(), pfree(), and value.
Referenced by test_radixtree().
|
static |
Definition at line 125 of file test_radixtree.c.
References ALLOCSET_SMALL_SIZES, AllocSetContextCreate, CurrentMemoryContext, dsa_create, dsa_detach(), EXPECT_FALSE, EXPECT_TRUE, sort-test::key, LWLockNewTrancheId(), LWLockRegisterTranche(), PG_UINT64_MAX, and rt_num_entries().
Referenced by test_radixtree().
Datum test_radixtree | ( | PG_FUNCTION_ARGS | ) |
Definition at line 446 of file test_radixtree.c.
References BITS_PER_BYTE, i, lengthof, PG_RETURN_VOID, rt_node_class_tests, test_basic(), test_empty(), and test_random().
|
static |
Definition at line 305 of file test_radixtree.c.
References ALLOCSET_SMALL_SIZES, AllocSetContextCreate, CurrentMemoryContext, dsa_create, dsa_detach(), EXPECT_EQ_U64, EXPECT_TRUE, GetCurrentTimestamp(), i, sort-test::key, key_cmp(), LWLockNewTrancheId(), LWLockRegisterTranche(), palloc(), pfree(), pg_prng_seed(), pg_prng_uint64(), qsort, rt_num_entries(), val, and value.
Referenced by test_radixtree().
PG_MODULE_MAGIC |
Definition at line 120 of file test_radixtree.c.
|
static |
Definition at line 72 of file test_radixtree.c.
Referenced by test_radixtree().