PostGIS 3.7.0dev-r@@SVN_REVISION@@
Loading...
Searching...
No Matches

◆ do_test_s32_varint()

static void do_test_s32_varint ( int32_t  nr,
int  expected_size,
char *  expected_res 
)
static

Definition at line 51 of file cu_varint.c.

52{
53 uint8_t buf[16];
54 int size;
55 char *hex;
56
57 size = varint_s32_encode_buf(nr, buf);
58 if ( size != expected_size )
59 {
60 printf("Expected: %d\nObtained: %d\n", expected_size, size);
61 }
62 CU_ASSERT_EQUAL(size,expected_size);
63
64 hex = hexbytes_from_bytes(buf, size);
65 ASSERT_STRING_EQUAL(hex, expected_res);
66 lwfree(hex);
67}
#define ASSERT_STRING_EQUAL(o, e)
char * hexbytes_from_bytes(const uint8_t *bytes, size_t size)
Definition lwout_wkb.c:40
void lwfree(void *mem)
Definition lwutil.c:248
size_t varint_s32_encode_buf(int32_t val, uint8_t *buf)
Definition varint.c:95

References ASSERT_STRING_EQUAL, hexbytes_from_bytes(), lwfree(), and varint_s32_encode_buf().

Referenced by test_varint().

Here is the call graph for this function:
Here is the caller graph for this function: