23 #define LEN_NO_TAIL(vectortype) (2 * sizeof(vectortype))
24 #define LEN_WITH_TAIL(vectortype) (LEN_NO_TAIL(vectortype) + 3)
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);
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);
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");
static bool pg_lfind8_le(uint8 key, uint8 *base, uint32 nelem)
static bool pg_lfind32(uint32 key, const uint32 *base, uint32 nelem)
static bool pg_lfind8(uint8 key, uint8 *base, uint32 nelem)
#define LEN_NO_TAIL(vectortype)
PG_FUNCTION_INFO_V1(test_lfind8)
Datum test_lfind8(PG_FUNCTION_ARGS)
Datum test_lfind32(PG_FUNCTION_ARGS)
Datum test_lfind8_le(PG_FUNCTION_ARGS)
#define LEN_WITH_TAIL(vectortype)
static void test_lfind8_le_internal(uint8 key)
static void test_lfind8_internal(uint8 key)