#include "postgres.h"
#include "fmgr.h"
#include "port/pg_lfind.h"
Go to the source code of this file.
◆ LEN_NO_TAIL
#define LEN_NO_TAIL |
( |
|
vectortype | ) |
(2 * sizeof(vectortype)) |
◆ LEN_WITH_TAIL
#define LEN_WITH_TAIL |
( |
|
vectortype | ) |
(LEN_NO_TAIL(vectortype) + 3) |
◆ TEST_ARRAY_SIZE
#define TEST_ARRAY_SIZE 135 |
◆ PG_FUNCTION_INFO_V1() [1/3]
◆ PG_FUNCTION_INFO_V1() [2/3]
◆ PG_FUNCTION_INFO_V1() [3/3]
◆ test_lfind32()
Definition at line 120 of file test_lfind.c.
122 #define TEST_ARRAY_SIZE 135
130 elog(
ERROR,
"pg_lfind32() found nonexistent element");
132 elog(
ERROR,
"pg_lfind32() did not find existing element");
135 elog(
ERROR,
"pg_lfind32() found nonexistent element");
137 elog(
ERROR,
"pg_lfind32() did not find existing element");
140 elog(
ERROR,
"pg_lfind32() found nonexistent element");
142 elog(
ERROR,
"pg_lfind32() did not find existing element");
145 elog(
ERROR,
"pg_lfind32() found nonexistent element");
elog(ERROR, "%s: %s", p2, msg)
static bool pg_lfind32(uint32 key, uint32 *base, uint32 nelem)
References elog(), ERROR, pg_lfind32(), PG_RETURN_VOID, and TEST_ARRAY_SIZE.
◆ test_lfind8()
◆ test_lfind8_internal()
static void test_lfind8_internal |
( |
uint8 |
key | ) |
|
|
static |
Definition at line 30 of file test_lfind.c.
36 memset(charbuf, 0xFF, len_with_tail);
38 charbuf[len_with_tail - 1] =
key;
40 elog(
ERROR,
"pg_lfind8() found nonexistent element '0x%x'",
key - 1);
42 elog(
ERROR,
"pg_lfind8() did not find existing element '0x%x'",
key);
44 elog(
ERROR,
"pg_lfind8() found nonexistent element '0x%x'",
key + 1);
46 memset(charbuf, 0xFF, len_with_tail);
48 charbuf[len_no_tail - 1] =
key;
50 elog(
ERROR,
"pg_lfind8() found nonexistent element '0x%x'",
key - 1);
52 elog(
ERROR,
"pg_lfind8() did not find existing element '0x%x'",
key);
54 elog(
ERROR,
"pg_lfind8() found nonexistent element '0x%x'",
key + 1);
static bool pg_lfind8(uint8 key, uint8 *base, uint32 nelem)
#define LEN_NO_TAIL(vectortype)
#define LEN_WITH_TAIL(vectortype)
References elog(), ERROR, sort-test::key, LEN_NO_TAIL, LEN_WITH_TAIL, and pg_lfind8().
Referenced by test_lfind8().
◆ test_lfind8_le()
◆ test_lfind8_le_internal()
static void test_lfind8_le_internal |
( |
uint8 |
key | ) |
|
|
static |
Definition at line 75 of file test_lfind.c.
81 memset(charbuf, 0xFF, len_with_tail);
83 charbuf[len_with_tail - 1] =
key;
85 elog(
ERROR,
"pg_lfind8_le() found nonexistent element <= '0x%x'",
key - 1);
87 elog(
ERROR,
"pg_lfind8_le() did not find existing element <= '0x%x'",
key);
89 elog(
ERROR,
"pg_lfind8_le() did not find existing element <= '0x%x'",
key + 1);
91 memset(charbuf, 0xFF, len_with_tail);
93 charbuf[len_no_tail - 1] =
key;
95 elog(
ERROR,
"pg_lfind8_le() found nonexistent element <= '0x%x'",
key - 1);
97 elog(
ERROR,
"pg_lfind8_le() did not find existing element <= '0x%x'",
key);
99 elog(
ERROR,
"pg_lfind8_le() did not find existing element <= '0x%x'",
key + 1);
static bool pg_lfind8_le(uint8 key, uint8 *base, uint32 nelem)
References elog(), ERROR, sort-test::key, LEN_NO_TAIL, LEN_WITH_TAIL, and pg_lfind8_le().
Referenced by test_lfind8_le().
◆ PG_MODULE_MAGIC