OPENDAP / libdap4

A new version of libdap that contains both DAP2 and DAP4 support
GNU Lesser General Public License v2.1
13 stars 14 forks source link

test suite fails on big endian arches after recent commit #195

Closed sharkcz closed 9 months ago

sharkcz commented 2 years ago

The test suite fails on big endian arches after commit 30290c121b09a2e08828fecc5878aa7e7c777b4c, because it adds only little-endian "gold" results.

...
243: trans ce vol_1_ce_2.xml /inst2 vol_1_ce_2.xml.1.trans_base FAILED (DMRTest.at:647)
244: trans ce vol_1_ce_2.xml inst2 vol_1_ce_2.xml.1.trans_base FAILED (DMRTest.at:648)
245: trans ce vol_1_ce_2.xml /inst2/Point vol_1_ce_2.xml.2.trans_base FAILED (DMRTest.at:649)
246: trans ce vol_1_ce_13.xml /inst2 vol_1_ce_13.xml.1.trans_base FAILED (DMRTest.at:651)
247: trans ce vol_1_ce_13.xml /inst2/inst3 vol_1_ce_13.xml.2.trans_base FAILED (DMRTest.at:652)
248: trans ce vol_1_ce_13.xml /attr_only_global vol_1_ce_13.xml.3.trans_base FAILED (DMRTest.at:654)
249: trans ce vol_1_ce_13.xml /inst2/attr_only vol_1_ce_13.xml.4.trans_base FAILED (DMRTest.at:655)

Could you remind me, how to generate the missing files? Or is there a deeper issue?

jgallagher59701 commented 2 years ago

In libdap4/tests run "./DMRTest -v --baselines=yes 243 244 ... 249" on a big endian machine. This will make baselines in the dmr-testsuite/bigendian dir with the suffix ".tmp". Give them a look to make sure they are valid and then rename to remove the .tmp if so and add/commit those new baselines.

However, the differences between the bigendian and littleendian baselines are only in the checksums. We could decide to test the correctness of the checksums separately and then, for the bulk of the tests, elide the checksum value from the baseline and from the response. This would save considerable effort as new tests are added. The loss is that the testing of the checksum values would be limited to set of tests specifically for those cases.

I used this technique in other code we have (and for things like error messages with code line numbers in a data server when that server is built in 'developer mode.'

Let me know what you think of this idea.

sharkcz commented 2 years ago

I think I will generate the big endian baseline files as a short term fix. But I like the idea of separating the checksum checks, so the tests data could be arch/endian agnostic.