PostGIS  3.0.6dev-r@@SVN_REVISION@@

◆ test_geohash_bbox()

static void test_geohash_bbox ( void  )
static

Definition at line 1142 of file cu_algorithm.c.

1143 {
1144  double lat[2], lon[2];
1145 
1146  /* SELECT ST_GeoHash(ST_SetSRID(ST_MakePoint(-126,48),4326)) */
1147  decode_geohash_bbox("c0w3hf1s70w3hf1s70w3", lat, lon, 100);
1148  CU_ASSERT_DOUBLE_EQUAL(lat[0], 48, 1e-11);
1149  CU_ASSERT_DOUBLE_EQUAL(lat[1], 48, 1e-11);
1150  CU_ASSERT_DOUBLE_EQUAL(lon[0], -126, 1e-11);
1151  CU_ASSERT_DOUBLE_EQUAL(lon[1], -126, 1e-11);
1152 
1154  decode_geohash_bbox("@@@@@@", lat, lon, 100);
1155  ASSERT_STRING_EQUAL(cu_error_msg, "decode_geohash_bbox: Invalid character '@'");
1156 }
void cu_error_msg_reset()
char cu_error_msg[MAX_CUNIT_ERROR_LENGTH+1]
#define ASSERT_STRING_EQUAL(o, e)
void decode_geohash_bbox(char *geohash, double *lat, double *lon, int precision)
Definition: lwalgorithm.c:720

References ASSERT_STRING_EQUAL, cu_error_msg, cu_error_msg_reset(), and decode_geohash_bbox().

Referenced by algorithms_suite_setup().

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