PostGIS  2.5.7dev-r@@SVN_REVISION@@

◆ do_test_s64_varint()

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.

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 }
#define ASSERT_STRING_EQUAL(o, e)
char * hexbytes_from_bytes(const uint8_t *bytes, size_t size)
Definition: lwout_wkb.c:39
void lwfree(void *mem)
Definition: lwutil.c:244
unsigned char uint8_t
Definition: uthash.h:79
size_t varint_s64_encode_buf(int64_t val, uint8_t *buf)
Definition: varint.c:89

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

Referenced by test_varint().

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