KovacsGG/mat4js

Need test cases

Opened this issue · 5 comments

The current test cases need to be replaced by more systematic ones that can be automated.

I'm not actually an avid user of matlab, so I'd appreciate some help with this. @VivekTRamamoorthy, sorry for calling out for you, publicly at that (as much as it is), I couldn't find a direct line to you. You expressed interest in this project, and also have a matlab-related project. Would you be willing to construct various .mat files, some to specification, some creatively?

Hi @KovacsGG, thank you for reaching out.
Sure, I could create some mat files. You can contact me on my email in my profile. Although I should say my availability this month is limited.

Check #10 : I have added number.mat, two more tests for char.mat and number.mat, and added a GitHub workflow.

Looks promising. I'll try to list the matfile features that may be tested for. I'm going by the documentation linked in the readme.

  • Header text
  • Header subsystem data offset (?)
  • File version
  • Endianness
  • Small data element format
  • File data types. These don't need dedicated test files, since they don't exist independently.
    • miCOMPRESSED
    • miMATRIX
    • miINT8
    • miUINT8
    • miINT16
    • miUINT16
    • miINT32
    • miUINT32
    • miINT64
    • miUINT64
    • miSINGLE
    • miDOUBLE
    • miUTF8
    • miUINT16
    • miUTF32
    • reserved (8, 10, 11)
  • MATLAB data types.
    • mxCELL_CLASS
    • mxSTRUCT_CLASS
    • mxOBJECT_CLASS
    • mxSPARSE_CLASS
    • mxCHAR_CLASS
    • Numeric/Char types
      • mxDOUBLE_CLASS
      • mxSINGLE_CLASS
      • mxINT8_CLASS
      • mxUINT8_CLASS
      • mxINT16_CLASS
      • mxUINT16_CLASS
      • mxINT32_CLASS
      • mxUINT32_CLASS
      • mxINT64_CLASS
      • mxUINT64_CLASS
      • Imaginary flag
      • Compression via integer demotion (at writing)
    • global, logical flag
  • Level 4 format

I've dug into the documentation on MathWorks, and it says you can produce uncompressed mat files by passing a flag to the save function. That'd be useful, so human eyes can verify it's indeed using the short data tag, or a given type, and such.

I pushed some test cases to better illustrate what I had in mind : 748a5e2

Notably, we're still missing a nice simple object sample, to be able to call the first set complete.

@KovacsGG Nice work! I am following your updates and merged them into my form. Could you merge the GitHub actions PR? I saw that it works in the fork and all your recent tests pass.