PostGIS  2.2.7dev-r@@SVN_REVISION@@
static void do_test_s64_varint ( int64_t  nr,
int  expected_size,
char *  expected_res 
)
static

Definition at line 87 of file cu_varint.c.

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

Referenced by test_varint().

88 {
89  uint8_t buf[16];
90  int size;
91  char *hex;
92 
93  size = varint_s64_encode_buf(nr, buf);
94  if ( size != expected_size )
95  {
96  printf("Expected: %d\nObtained: %d\n", expected_size, size);
97  }
98  CU_ASSERT_EQUAL(size,expected_size);
99 
100  hex = hexbytes_from_bytes(buf,size);
101  ASSERT_STRING_EQUAL(hex, expected_res);
102  lwfree(hex);
103 }
void lwfree(void *mem)
Definition: lwutil.c:214
#define ASSERT_STRING_EQUAL(o, e)
char * hexbytes_from_bytes(uint8_t *bytes, size_t size)
Definition: lwout_wkb.c:25
size_t varint_s64_encode_buf(int64_t val, uint8_t *buf)
Definition: varint.c:81

Here is the call graph for this function:

Here is the caller graph for this function: