mirror of https://github.com/ecmwf/eccodes.git
Testing: Increase coverage
This commit is contained in:
parent
699491023d
commit
501fa84cad
|
@ -32,7 +32,7 @@ int main(int argc, char* argv[])
|
||||||
size_t stringLen;
|
size_t stringLen;
|
||||||
char stringVal[100] = {0,};
|
char stringVal[100] = {0,};
|
||||||
int i, err = 0;
|
int i, err = 0;
|
||||||
int cnt = 0;
|
int cnt = 0, ktype = 0;
|
||||||
const char* infile = "../../data/bufr/synop_multi_subset.bufr";
|
const char* infile = "../../data/bufr/synop_multi_subset.bufr";
|
||||||
|
|
||||||
in = fopen(infile, "rb");
|
in = fopen(infile, "rb");
|
||||||
|
@ -62,6 +62,9 @@ int main(int argc, char* argv[])
|
||||||
for (i = 1; i <= numberOfSubsets; i++) {
|
for (i = 1; i <= numberOfSubsets; i++) {
|
||||||
snprintf(key, sizeof(key), "/subsetNumber=%d/blockNumber", i);
|
snprintf(key, sizeof(key), "/subsetNumber=%d/blockNumber", i);
|
||||||
|
|
||||||
|
CODES_CHECK(codes_get_native_type(h, key, &ktype), 0);
|
||||||
|
//printf("Type = %d\n", ktype);
|
||||||
|
|
||||||
printf(" subsetNumber=%d", i);
|
printf(" subsetNumber=%d", i);
|
||||||
/* read and print some data values */
|
/* read and print some data values */
|
||||||
CODES_CHECK(codes_get_long(h, key, &longVal), 0);
|
CODES_CHECK(codes_get_long(h, key, &longVal), 0);
|
||||||
|
|
|
@ -1162,7 +1162,6 @@ int grib_get_double_elements(const grib_handle* h, const char* name, const int*
|
||||||
int grib_get_float_elements(const grib_handle* h, const char* name, const int* index_array, long len, float* val_array);
|
int grib_get_float_elements(const grib_handle* h, const char* name, const int* index_array, long len, float* val_array);
|
||||||
int grib_get_string_internal(grib_handle* h, const char* name, char* val, size_t* length);
|
int grib_get_string_internal(grib_handle* h, const char* name, char* val, size_t* length);
|
||||||
int grib_get_string(const grib_handle* h, const char* name, char* val, size_t* length);
|
int grib_get_string(const grib_handle* h, const char* name, char* val, size_t* length);
|
||||||
int grib_get_bytes_internal(const grib_handle* h, const char* name, unsigned char* val, size_t* length);
|
|
||||||
int grib_get_bytes(const grib_handle* h, const char* name, unsigned char* val, size_t* length);
|
int grib_get_bytes(const grib_handle* h, const char* name, unsigned char* val, size_t* length);
|
||||||
int grib_get_native_type(const grib_handle* h, const char* name, int* type);
|
int grib_get_native_type(const grib_handle* h, const char* name, int* type);
|
||||||
int ecc__grib_get_double_array_internal(const grib_handle* h, grib_accessor* a, double* val, size_t buffer_len, size_t* decoded_length);
|
int ecc__grib_get_double_array_internal(const grib_handle* h, grib_accessor* a, double* val, size_t buffer_len, size_t* decoded_length);
|
||||||
|
|
|
@ -1218,17 +1218,15 @@ int grib_get_string(const grib_handle* h, const char* name, char* val, size_t* l
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
int grib_get_bytes_internal(const grib_handle* h, const char* name, unsigned char* val, size_t* length)
|
// int grib_get_bytes_internal(const grib_handle* h, const char* name, unsigned char* val, size_t* length)
|
||||||
{
|
// {
|
||||||
int ret = grib_get_bytes(h, name, val, length);
|
// int ret = grib_get_bytes(h, name, val, length);
|
||||||
|
// if (ret != GRIB_SUCCESS)
|
||||||
if (ret != GRIB_SUCCESS)
|
// grib_context_log(h->context, GRIB_LOG_ERROR,
|
||||||
grib_context_log(h->context, GRIB_LOG_ERROR,
|
// "Unable to get %s as bytes (%s)",
|
||||||
"Unable to get %s as bytes (%s)",
|
// name, grib_get_error_message(ret));
|
||||||
name, grib_get_error_message(ret));
|
// return ret;
|
||||||
|
// }
|
||||||
return ret;
|
|
||||||
}
|
|
||||||
|
|
||||||
int grib_get_bytes(const grib_handle* h, const char* name, unsigned char* val, size_t* length)
|
int grib_get_bytes(const grib_handle* h, const char* name, unsigned char* val, size_t* length)
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in New Issue