HDFGroup / HDF.PInvoke

Raw HDF5 Power for .NET
http://www.hdfgroup.org/HDF5
Other
80 stars 29 forks source link

The test H5Lunpack_elink_valTest3 fails on Linux. #160

Open Apollo3zehn opened 5 years ago

Apollo3zehn commented 5 years ago

Problem

When I build HDF.PInvoke under Linux using AppVeyor, a single test fails (see here: https://ci.appveyor.com/project/Apollo3zehn/hdf-pinvoke-netstandard/builds/24840707)

The failing line of code is: https://github.com/HDFGroup/HDF.PInvoke/blob/90b1c76e99659d47e665a3079bc9f21c48122708/UnitTests/H5LTest/H5Lunpack_elink_val.cs#L182-L183

The reason is that, before this test is executed, this one runs:

https://github.com/HDFGroup/HDF.PInvoke/blob/90b1c76e99659d47e665a3079bc9f21c48122708/UnitTests/H5LTest/H5Lget_name_by_idx.cs#L82-L94

This test creates an external link (create_external) in the root of the test file. Later, when the failing test runs, it tries to create a group with same name of that link and fails. Here is a copy of the HDF5 file right before the test fails: tmp973T4B.tmp.zip

Screenshot

grafik

The failing test tries to create a group with name Ελληνικά which already exists.

Solution

A solution could be to not consume all UTF-8 names in the loop here:

https://github.com/HDFGroup/HDF.PInvoke/blob/90b1c76e99659d47e665a3079bc9f21c48122708/UnitTests/H5LTest/H5Lget_name_by_idx.cs#L89

Instead, let the loop start at int i = 1. But that might not be very clean. Maybe a totally different group name is required in the H5Lunpack_elink_valTest3 test.

A am not quite sure why this error only happens on Linux. My only guess is that the tests are executed in a different order on Windows and Linux.