PostGIS  2.5.0dev-r@@SVN_REVISION@@

◆ test_band_new_offline_from_path()

static void test_band_new_offline_from_path ( )
static

Definition at line 1262 of file cu_band_basics.c.

References ovdump::band, band_basics_suite_setup(), ES_NONE, FALSE, rt_band_check_is_nodata(), rt_band_destroy(), rt_band_get_ext_band_num(), rt_band_get_ext_path(), rt_band_get_height(), rt_band_get_width(), rt_band_is_offline(), and rt_band_new_offline_from_path().

Referenced by band_basics_suite_setup().

1262  {
1263  rt_band band = NULL;
1264  int width = 10;
1265  int height = 10;
1266  char *path = "../regress/loader/testraster.tif";
1267  uint8_t extband = 0;
1268 
1269  /* offline band */
1271  width, height,
1272  0, 0,
1273  2, path,
1274  FALSE
1275  );
1276  CU_ASSERT(band != NULL);
1277 
1278  /* isoffline */
1279  CU_ASSERT(rt_band_is_offline(band));
1280 
1281  /* ext path */
1282  CU_ASSERT_STRING_EQUAL(rt_band_get_ext_path(band), path);
1283 
1284  /* ext band number */
1285  CU_ASSERT_EQUAL(rt_band_get_ext_band_num(band, &extband), ES_NONE);
1286  CU_ASSERT_EQUAL(extband, 1);
1287 
1288  /* test rt_band_check_is_nodata */
1289  CU_ASSERT_EQUAL(rt_band_check_is_nodata(band), FALSE);
1290 
1291  /* dimensions */
1292  CU_ASSERT_EQUAL(rt_band_get_width(band), width);
1293  CU_ASSERT_EQUAL(rt_band_get_height(band), height);
1294 
1295  rt_band_destroy(band);
1296 }
band
Definition: ovdump.py:57
int rt_band_is_offline(rt_band band)
Return non-zero if the given band data is on the filesystem.
Definition: rt_band.c:329
rt_band rt_band_new_offline_from_path(uint16_t width, uint16_t height, int hasnodata, double nodataval, uint8_t bandNum, const char *path, int force)
Create an out-db rt_band from path.
Definition: rt_band.c:199
void rt_band_destroy(rt_band band)
Destroy a raster band.
Definition: rt_band.c:340
const char * rt_band_get_ext_path(rt_band band)
Return band's external path (only valid when rt_band_is_offline returns non-zero).
Definition: rt_band.c:363
int rt_band_check_is_nodata(rt_band band)
Returns TRUE if the band is only nodata values.
Definition: rt_band.c:1752
uint16_t rt_band_get_width(rt_band band)
Return width of this band.
Definition: rt_band.c:640
uint16_t rt_band_get_height(rt_band band)
Return height of this band.
Definition: rt_band.c:649
rt_errorstate rt_band_get_ext_band_num(rt_band band, uint8_t *bandnum)
Return bands' external band number (only valid when rt_band_is_offline returns non-zero).
Definition: rt_band.c:376
#define FALSE
Definition: dbfopen.c:168
unsigned char uint8_t
Definition: uthash.h:79
Here is the call graph for this function:
Here is the caller graph for this function: