NOAA-EMC / NCEPLIBS-bufr

The NCEPLIBS-bufr library contains routines and utilites for working with the WMO BUFR format.
Other
44 stars 19 forks source link

add test for utils/debufr.c #345

Closed edwardhartnett closed 1 year ago

edwardhartnett commented 1 year ago

Looking at the code coverage, I see that the following input cases are not tested:

            case 'v':
                bvers ( bvstr, sizeof(bvstr) );
                /* append a trailing NULL to bvstr for printf */
                for ( ii = 0; ii < sizeof(bvstr); ii++ ) {
                    if ( ( bvstr[ii] != '.' ) && ( !isdigit(bvstr[ii]) ) ) {
                        bvstr[ii] = '\0';
                        break;
                    }
                }
                printf( "This is debufr v4.0.0, built with BUFRLIB v%s\n", bvstr );
                return 0;
            case 'h':
                printf( "\nPROGRAM %s\n", argv[0] );
                printf( "\nABSTRACT: This program decodes a BUFR file and generates a verbose\n" );
                printf( "  listing of the contents.  If a DX BUFR tables file is specified\n" );
                printf( "  (using the -f option) or if the specified BUFR file contains an\n" );
                printf( "  embedded DX BUFR tables message as the first message in the file,\n" );
                printf( "  then this DX BUFR tables information is used to decode the data\n" );
                printf( "  messages in the file.  Otherwise, or whenever the -m option is\n" );
                printf( "  specified, master BUFR tables are read and used to decode the\n" );
                printf( "  data messages in the file.\n" );
                prtusage( argv[0] );
                return 0;
                break;
            case 'b':
                basic = 'Y';
                break;
            case 'm':
                forcemt = 'Y';
                break;

So these cases can all be tested.

edwardhartnett commented 1 year ago

See discussion in #357

This should be done after #376.