Testing: Increase coverage

This commit is contained in:
Shahram Najm 2024-01-19 12:44:37 +00:00
parent 699491023d
commit 501fa84cad
3 changed files with 13 additions and 13 deletions

View File

@ -32,7 +32,7 @@ int main(int argc, char* argv[])
size_t stringLen;
char stringVal[100] = {0,};
int i, err = 0;
int cnt = 0;
int cnt = 0, ktype = 0;
const char* infile = "../../data/bufr/synop_multi_subset.bufr";
in = fopen(infile, "rb");
@ -62,6 +62,9 @@ int main(int argc, char* argv[])
for (i = 1; i <= numberOfSubsets; 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);
/* read and print some data values */
CODES_CHECK(codes_get_long(h, key, &longVal), 0);

View File

@ -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_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_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_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);

View File

@ -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 ret = grib_get_bytes(h, name, val, length);
if (ret != GRIB_SUCCESS)
grib_context_log(h->context, GRIB_LOG_ERROR,
"Unable to get %s as bytes (%s)",
name, grib_get_error_message(ret));
return ret;
}
// 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);
// if (ret != GRIB_SUCCESS)
// grib_context_log(h->context, GRIB_LOG_ERROR,
// "Unable to get %s as bytes (%s)",
// name, grib_get_error_message(ret));
// return ret;
// }
int grib_get_bytes(const grib_handle* h, const char* name, unsigned char* val, size_t* length)
{