mirror of https://github.com/ecmwf/eccodes.git
Testing: Coverage
This commit is contained in:
parent
c38285e567
commit
3fc47dcf77
|
@ -12,12 +12,6 @@
|
||||||
#undef NDEBUG
|
#undef NDEBUG
|
||||||
#include <assert.h>
|
#include <assert.h>
|
||||||
|
|
||||||
static void usage(const char* prog)
|
|
||||||
{
|
|
||||||
printf("usage: %s [-a|-d] infile\n", prog);
|
|
||||||
exit(1);
|
|
||||||
}
|
|
||||||
|
|
||||||
#define ITER_ALL_KEYS 1
|
#define ITER_ALL_KEYS 1
|
||||||
#define ITER_DATA_KEYS 2
|
#define ITER_DATA_KEYS 2
|
||||||
|
|
||||||
|
@ -28,12 +22,11 @@ int main(int argc, char* argv[])
|
||||||
codes_handle* h = NULL;
|
codes_handle* h = NULL;
|
||||||
codes_bufr_keys_iterator* kiter = NULL;
|
codes_bufr_keys_iterator* kiter = NULL;
|
||||||
char* input_filename = NULL;
|
char* input_filename = NULL;
|
||||||
const char* prog = argv[0];
|
|
||||||
FILE* f = NULL;
|
FILE* f = NULL;
|
||||||
int iterator_mode = ITER_ALL_KEYS;
|
int iterator_mode = ITER_ALL_KEYS;
|
||||||
|
|
||||||
if (argc == 1 || argc > 3)
|
if (argc == 1 || argc > 3)
|
||||||
usage(prog);
|
return 1; // usage: prog [-a|-d] infile
|
||||||
|
|
||||||
for (i = 1; i < argc; i++) {
|
for (i = 1; i < argc; i++) {
|
||||||
if (strcmp(argv[i], "-a") == 0) {
|
if (strcmp(argv[i], "-a") == 0) {
|
||||||
|
|
|
@ -10,12 +10,6 @@
|
||||||
|
|
||||||
#include "grib_api.h"
|
#include "grib_api.h"
|
||||||
|
|
||||||
static void usage(char* prog)
|
|
||||||
{
|
|
||||||
printf("usage: %s file1.grib file2.grib\n", prog);
|
|
||||||
exit(1);
|
|
||||||
}
|
|
||||||
|
|
||||||
int main(int argc, char* argv[])
|
int main(int argc, char* argv[])
|
||||||
{
|
{
|
||||||
grib_handle *h1, *h2;
|
grib_handle *h1, *h2;
|
||||||
|
@ -34,7 +28,7 @@ int main(int argc, char* argv[])
|
||||||
|
|
||||||
c = grib_context_get_default();
|
c = grib_context_get_default();
|
||||||
|
|
||||||
if (argc < 3) usage(argv[0]);
|
if (argc < 3) return 1;//usage: %s file1.grib file2.grib
|
||||||
|
|
||||||
infile1 = argv[1];
|
infile1 = argv[1];
|
||||||
infile2 = argv[2];
|
infile2 = argv[2];
|
||||||
|
|
|
@ -12,11 +12,6 @@
|
||||||
#undef NDEBUG
|
#undef NDEBUG
|
||||||
#include <assert.h>
|
#include <assert.h>
|
||||||
|
|
||||||
static void usage(const char* app)
|
|
||||||
{
|
|
||||||
fprintf(stderr, "Usage is: %s input_file ouput_file\n", app);
|
|
||||||
}
|
|
||||||
|
|
||||||
int main(int argc, char* argv[])
|
int main(int argc, char* argv[])
|
||||||
{
|
{
|
||||||
FILE* in = NULL;
|
FILE* in = NULL;
|
||||||
|
@ -32,7 +27,7 @@ int main(int argc, char* argv[])
|
||||||
size_t messageLength_src = 0, messageLength_dst = 0;
|
size_t messageLength_src = 0, messageLength_dst = 0;
|
||||||
|
|
||||||
if (argc != 3) {
|
if (argc != 3) {
|
||||||
usage(argv[0]);
|
// Usage: prog input_file ouput_file
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -73,7 +68,7 @@ int main(int argc, char* argv[])
|
||||||
assert(isConstant_dst == 1);
|
assert(isConstant_dst == 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* write out the cloned buffer */
|
// write out the cloned buffer
|
||||||
if (fwrite(buffer, 1, messageLength_dst, out) != messageLength_dst) {
|
if (fwrite(buffer, 1, messageLength_dst, out) != messageLength_dst) {
|
||||||
perror(argv[1]);
|
perror(argv[1]);
|
||||||
return 1;
|
return 1;
|
||||||
|
|
|
@ -8,6 +8,9 @@
|
||||||
* virtue of its status as an intergovernmental organisation nor does it submit to any jurisdiction.
|
* virtue of its status as an intergovernmental organisation nor does it submit to any jurisdiction.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
//
|
||||||
|
// ECC-1467: Support data values array decoded as "floats" (single-precision)
|
||||||
|
//
|
||||||
#include <math.h>
|
#include <math.h>
|
||||||
#include "eccodes.h"
|
#include "eccodes.h"
|
||||||
#include "grib_api_internal.h"
|
#include "grib_api_internal.h"
|
||||||
|
@ -60,8 +63,7 @@ int main(int argc, char** argv)
|
||||||
fval = fvalues[i];
|
fval = fvalues[i];
|
||||||
|
|
||||||
if (!((dmin <= fval) && (fval <= dmax))) {
|
if (!((dmin <= fval) && (fval <= dmax))) {
|
||||||
fprintf(stderr, "Error:\n");
|
fprintf(stderr, "Error: dvalue: %f, fvalue: %f\n", dvalues[i], fvalues[i]);
|
||||||
fprintf(stderr, "dvalue: %f, fvalue: %f\n", dvalues[i], fvalues[i]);
|
|
||||||
fprintf(stderr, "\tmin < fvalue < max = %.20e < %.20e < %.20e FAILED\n",
|
fprintf(stderr, "\tmin < fvalue < max = %.20e < %.20e < %.20e FAILED\n",
|
||||||
dmin, fvalues[i], dmax);
|
dmin, fvalues[i], dmax);
|
||||||
fprintf(stderr, "\tfvalue - min = %.20e (%s)\n",
|
fprintf(stderr, "\tfvalue - min = %.20e (%s)\n",
|
||||||
|
|
|
@ -8,6 +8,8 @@
|
||||||
# virtue of its status as an intergovernmental organisation nor does it submit to any jurisdiction.
|
# virtue of its status as an intergovernmental organisation nor does it submit to any jurisdiction.
|
||||||
#
|
#
|
||||||
|
|
||||||
|
# ECC-1467: Support data values array decoded as "floats" (single-precision)
|
||||||
|
|
||||||
. ./include.ctest.sh
|
. ./include.ctest.sh
|
||||||
|
|
||||||
# Constant fields
|
# Constant fields
|
||||||
|
|
|
@ -13,12 +13,6 @@
|
||||||
|
|
||||||
#include "grib_api.h"
|
#include "grib_api.h"
|
||||||
|
|
||||||
static void usage(const char* prog)
|
|
||||||
{
|
|
||||||
fprintf(stderr, "Usage: %s order_by grib_file grib_file ...\n", prog);
|
|
||||||
exit(1);
|
|
||||||
}
|
|
||||||
|
|
||||||
int main(int argc, char** argv)
|
int main(int argc, char** argv)
|
||||||
{
|
{
|
||||||
int err = 0;
|
int err = 0;
|
||||||
|
@ -34,7 +28,7 @@ int main(int argc, char** argv)
|
||||||
size_t lenDate = 10, lenParam = 20, lenLevel = 50;
|
size_t lenDate = 10, lenParam = 20, lenLevel = 50;
|
||||||
char* order_by = NULL;
|
char* order_by = NULL;
|
||||||
|
|
||||||
if (argc != 3) usage(argv[0]);
|
if (argc != 3) return 1; //Usage: prog order_by grib_file grib_file ...
|
||||||
|
|
||||||
nkeys = sizeof(keys) / sizeof(*keys);
|
nkeys = sizeof(keys) / sizeof(*keys);
|
||||||
order_by = argv[1];
|
order_by = argv[1];
|
||||||
|
|
|
@ -10,12 +10,6 @@
|
||||||
|
|
||||||
#include "grib_api.h"
|
#include "grib_api.h"
|
||||||
|
|
||||||
void usage(char* prog)
|
|
||||||
{
|
|
||||||
printf("usage: %s infile\n", prog);
|
|
||||||
exit(1);
|
|
||||||
}
|
|
||||||
|
|
||||||
int main(int argc, char* argv[])
|
int main(int argc, char* argv[])
|
||||||
{
|
{
|
||||||
grib_index* index = NULL;
|
grib_index* index = NULL;
|
||||||
|
@ -27,7 +21,7 @@ int main(int argc, char* argv[])
|
||||||
size_t lenshortName = 200;
|
size_t lenshortName = 200;
|
||||||
int ret = 0, count = 0;
|
int ret = 0, count = 0;
|
||||||
|
|
||||||
if (argc != 2) usage(argv[0]);
|
if (argc != 2) return 1;
|
||||||
infile = argv[1];
|
infile = argv[1];
|
||||||
outfile = argv[2];
|
outfile = argv[2];
|
||||||
|
|
||||||
|
|
|
@ -14,12 +14,6 @@
|
||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
void usage(const char* prog)
|
|
||||||
{
|
|
||||||
printf("usage: %s filename\n", prog);
|
|
||||||
exit(1);
|
|
||||||
}
|
|
||||||
|
|
||||||
int main(int argc, char* argv[])
|
int main(int argc, char* argv[])
|
||||||
{
|
{
|
||||||
off_t offsetin = 0, offsetout = 0;
|
off_t offsetin = 0, offsetout = 0;
|
||||||
|
@ -30,7 +24,7 @@ int main(int argc, char* argv[])
|
||||||
char str[10];
|
char str[10];
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
if (argc != 2) usage(argv[0]);
|
if (argc != 2) return 1;
|
||||||
|
|
||||||
printf("sizeof(off_t)=%zu sizeof(long)=%zu\n", sizeof(off_t), sizeof(long));
|
printf("sizeof(off_t)=%zu sizeof(long)=%zu\n", sizeof(off_t), sizeof(long));
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue