Groonga 3.0.9 Source Code Document
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
Data Structures | Macros | Typedefs
test-patricia-trie.h File Reference
#include <pat.h>
#include <gcutter.h>
#include <glib/gstdio.h>
#include "../lib/grn-assertions.h"
Include dependency graph for test-patricia-trie.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  _grn_trie_test_data

Macros

#define DEFAULT_VALUE_SIZE   64
#define clear_messages()   grn_collect_logger_clear_messages(logger)
#define messages()   grn_collect_logger_get_messages(logger)
#define open_context()
#define cut_assert_open_context()
#define create_trie()
#define cut_assert_create_trie()
#define open_trie()   trie = grn_pat_open(context, default_path)
#define cut_assert_open_trie()
#define cut_assert_fail_open_trie()
#define GRN_TABLE_ADD   (0x01<<6)
#define lookup(key, key_size, flags)
#define cut_assert_lookup(key, key_size, flags)
#define cut_assert_lookup_failed(key, key_size, flags)
#define cut_assert_lookup_add(key)
#define put_sample_entry()
#define open_cursor()
#define cut_assert_open_cursor()

Typedefs

typedef int grn_search_flags
typedef struct _grn_trie_test_data grn_trie_test_data
typedef void(* increment_key_func )(grn_trie_test_data *test_data)

Macro Definition Documentation

#define clear_messages ( )    grn_collect_logger_clear_messages(logger)

Definition at line 156 of file test-patricia-trie.h.

#define create_trie ( )
Value:
do \
{ \
GRN_CTX_SET_ENCODING(context, default_encoding); \
trie = grn_pat_create(context, default_path, default_key_size, \
default_value_size, default_flags); \
} while (0)

Definition at line 177 of file test-patricia-trie.h.

#define cut_assert_create_trie ( )
Value:
do \
{ \
cut_assert_open_context(); \
trie_free(); \
create_trie(); \
grn_test_assert_context(context); \
cut_assert(trie); \
} while (0)

Definition at line 184 of file test-patricia-trie.h.

#define cut_assert_fail_open_trie ( )
Value:
do \
{ \
cut_assert_open_context(); \
trie_free(); \
open_trie(); \
cut_assert_null(trie); \
} while (0)

Definition at line 206 of file test-patricia-trie.h.

#define cut_assert_lookup (   key,
  key_size,
  flags 
)
Value:
do \
{ \
grn_test_assert_not_nil((id = lookup(key, key_size, (flags))), \
cut_message("flags: <%d>", *(flags))); \
} while (0)

Definition at line 223 of file test-patricia-trie.h.

#define cut_assert_lookup_add (   key)

Definition at line 235 of file test-patricia-trie.h.

#define cut_assert_lookup_failed (   key,
  key_size,
  flags 
)
Value:
do \
{ \
grn_test_assert_nil(lookup(key, key_size, (flags)), \
cut_message("flags: <%d>", *(flags))); \
} while (0)

Definition at line 229 of file test-patricia-trie.h.

#define cut_assert_open_context ( )
Value:
do \
{ \
context_free(); \
open_context(); \
cut_assert(context); \
} while (0)

Definition at line 170 of file test-patricia-trie.h.

#define cut_assert_open_cursor ( )
Value:
do \
{ \
clear_messages(); \
cursor_free(); \
open_cursor(); \
cut_assert_equal_g_list_string(NULL, messages()); \
cut_assert(cursor); \
} while (0)

Definition at line 294 of file test-patricia-trie.h.

#define cut_assert_open_trie ( )
Value:
do \
{ \
clear_messages(); \
cut_assert_open_context(); \
trie_free(); \
open_trie(); \
gcut_assert_equal_list_string(NULL, messages()); \
cut_assert(trie); \
} while (0)

Definition at line 196 of file test-patricia-trie.h.

#define DEFAULT_VALUE_SIZE   64

Definition at line 26 of file test-patricia-trie.h.

#define GRN_TABLE_ADD   (0x01<<6)

Definition at line 216 of file test-patricia-trie.h.

#define lookup (   key,
  key_size,
  flags 
)
Value:
(((*(flags) & GRN_TABLE_ADD)) \
? grn_pat_add(context, trie, key, key_size, &value, flags) \
: grn_pat_get(context, trie, key, key_size, &value))

Definition at line 218 of file test-patricia-trie.h.

#define messages ( )    grn_collect_logger_get_messages(logger)

Definition at line 159 of file test-patricia-trie.h.

#define open_context ( )
Value:
do \
{ \
context = g_new0(grn_ctx, 1); \
grn_test_assert(grn_ctx_init(context, \
default_context_flags)); \
GRN_CTX_SET_ENCODING(context, default_encoding); \
} while (0)

Definition at line 162 of file test-patricia-trie.h.

#define open_cursor ( )
Value:
cursor = grn_pat_cursor_open(context, trie, \
default_cursor_min, \
default_cursor_min_size, \
default_cursor_max, \
default_cursor_max_size, \
default_cursor_offset, \
default_cursor_limit, \
default_cursor_flags)

Definition at line 284 of file test-patricia-trie.h.

#define open_trie ( )    trie = grn_pat_open(context, default_path)

Definition at line 193 of file test-patricia-trie.h.

#define put_sample_entry ( )
Value:
do \
{ \
cut_assert_lookup_add(sample_key); \
sample_id = id; \
} while (0)

Definition at line 278 of file test-patricia-trie.h.

Typedef Documentation

typedef int grn_search_flags

Definition at line 214 of file test-patricia-trie.h.

Definition at line 303 of file test-patricia-trie.h.

typedef void(* increment_key_func)(grn_trie_test_data *test_data)

Definition at line 304 of file test-patricia-trie.h.