PostGIS  2.4.9dev-r@@SVN_REVISION@@

◆ do_test_u64_varint()

static void do_test_u64_varint ( uint64_t  nr,
int  expected_size,
char *  expected_res 
)
static

Definition at line 69 of file cu_varint.c.

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

Referenced by test_varint().

70 {
71  uint8_t buf[16];
72  int size;
73  char *hex;
74 
75  size = varint_u64_encode_buf(nr, buf);
76  if ( size != expected_size )
77  {
78  printf("Expected: %d\nObtained: %d\n", expected_size, size);
79  }
80  CU_ASSERT_EQUAL(size,expected_size);
81 
82  hex = hexbytes_from_bytes(buf,size);
83  ASSERT_STRING_EQUAL(hex, expected_res);
84  lwfree(hex);
85 }
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
size_t varint_u64_encode_buf(uint64_t val, uint8_t *buf)
Definition: varint.c:76
unsigned char uint8_t
Definition: uthash.h:79
Here is the call graph for this function:
Here is the caller graph for this function: