PostGIS  2.4.9dev-r@@SVN_REVISION@@

◆ test_geohash_bbox()

static void test_geohash_bbox ( void  )
static

Definition at line 929 of file cu_algorithm.c.

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

Referenced by algorithms_suite_setup().

930 {
931  double lat[2], lon[2];
932 
933  /* SELECT ST_GeoHash(ST_SetSRID(ST_MakePoint(-126,48),4326)) */
934  decode_geohash_bbox("c0w3hf1s70w3hf1s70w3", lat, lon, 100);
935  CU_ASSERT_DOUBLE_EQUAL(lat[0], 48, 1e-11);
936  CU_ASSERT_DOUBLE_EQUAL(lat[1], 48, 1e-11);
937  CU_ASSERT_DOUBLE_EQUAL(lon[0], -126, 1e-11);
938  CU_ASSERT_DOUBLE_EQUAL(lon[1], -126, 1e-11);
939 
941  decode_geohash_bbox("@@@@@@", lat, lon, 100);
942  ASSERT_STRING_EQUAL(cu_error_msg, "decode_geohash_bbox: Invalid character '@'");
943 }
#define ASSERT_STRING_EQUAL(o, e)
void decode_geohash_bbox(char *geohash, double *lat, double *lon, int precision)
Definition: lwalgorithm.c:704
void cu_error_msg_reset()
char cu_error_msg[MAX_CUNIT_ERROR_LENGTH+1]
Here is the call graph for this function:
Here is the caller graph for this function: