PostGIS  2.4.9dev-r@@SVN_REVISION@@

◆ do_test_u32_varint()

static void do_test_u32_varint ( uint32_t  nr,
int  expected_size,
char *  expected_res 
)
static

Definition at line 34 of file cu_varint.c.

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

Referenced by test_varint().

35 {
36  int size;
37  char *hex;
38  uint8_t buf[16];
39 
40  size = varint_u32_encode_buf(nr, buf);
41  if ( size != expected_size )
42  printf("Expected: %d\nObtained: %d\n", expected_size, size);
43 
44  CU_ASSERT_EQUAL(size, expected_size);
45 
46  hex = hexbytes_from_bytes(buf, size);
47  ASSERT_STRING_EQUAL(hex, expected_res);
48  lwfree(hex);
49 }
size_t varint_u32_encode_buf(uint32_t val, uint8_t *buf)
Definition: varint.c:83
void lwfree(void *mem)
Definition: lwutil.c:244
#define ASSERT_STRING_EQUAL(o, e)
char * hexbytes_from_bytes(uint8_t *bytes, size_t size)
Definition: lwout_wkb.c:39
unsigned char uint8_t
Definition: uthash.h:79
Here is the call graph for this function:
Here is the caller graph for this function: