ECCC-MSC / libecbufr

libecbufr is a general purpose, template-oriented BUFR encoding/decoding library
Other
10 stars 7 forks source link

decoder should fail on missing descriptors #6

Open vsouvan opened 4 years ago

vsouvan commented 4 years ago

Tests/BUFR/is_winide_BLDU.bufr, among other things, uses local descriptor 0-01-204 which has no entry in the current default tables. So the test fails, generating a gibberish decode. The decoder should fail as soon as it encounters a descriptor for which it doesn't know the data bit width.


Imported from Launchpad using lp2gh.

vsouvan commented 4 years ago

(by vanh-souvanlasy) most of the BUFR test files in Tests/BUFR uses the local descriptor 0-01-204, so more than half of the tests will fail the same way (unknown descriptor). To continue using these test files, The tests will need to be changed by using local table B to run the tests.

vsouvan commented 4 years ago

(by vanh-souvanlasy) A local table B has been added to tests suite. It contains all the local descriptors used by the BUFR files included in the tests. This local table B is now used by in tests scripts to allow currently defined tests to completed as before. Also added is a test which outline the decoder new behavior of aborting the test when unknown descriptor(s) are found.

vsouvan commented 4 years ago

(by vanh-souvanlasy) decoder now abort if an unknown descriptor is found

vsouvan commented 4 years ago

(by yves-pelletier) This behaviour needs to be modulated by the presence of an operator 206YYY immediately preceding the unknown descriptor. In this case, there should simply be a warning that an unknown descriptor of width YYY has been skipped and that decoding is continuing.

vsouvan commented 4 years ago

(by chris-beauregard) I knew there was a reason why I chose the specific wording of "for which it doesn't know the data bit width" when I created the bug report...

vsouvan commented 4 years ago

(by vanh-souvanlasy) now check for preceding descriptor for signify data width operator before rejecting an unkown descriptor.

vsouvan commented 4 years ago

(by vanh-souvanlasy) By allowing unknown descriptors following 206YYY operator, validation need to be done on that descriptor to make sure it follows the BUFR descriptors definition FXXYYY of acceptable values.

vsouvan commented 4 years ago

(by vanh-souvanlasy) this was fixed in 0.8.2 before release date 12/02/2009