mat4js icon indicating copy to clipboard operation
mat4js copied to clipboard

Need test cases

Open KovacsGG opened this issue 3 years ago • 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?

KovacsGG avatar Aug 10 '22 03:08 KovacsGG

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.

VivekTRamamoorthy avatar Aug 10 '22 06:08 VivekTRamamoorthy

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

VivekTRamamoorthy avatar Aug 10 '22 10:08 VivekTRamamoorthy

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.
    • [x] mxCELL_CLASS
    • [x] mxSTRUCT_CLASS
    • [ ] mxOBJECT_CLASS
    • [x] mxSPARSE_CLASS
    • [x] mxCHAR_CLASS
    • Numeric/Char types
      • [x] mxDOUBLE_CLASS
      • [x] mxSINGLE_CLASS
      • [x] mxINT8_CLASS
      • [x] mxUINT8_CLASS
      • [x] mxINT16_CLASS
      • [x] mxUINT16_CLASS
      • [x] mxINT32_CLASS
      • [x] mxUINT32_CLASS
      • [x] mxINT64_CLASS
      • [x] mxUINT64_CLASS
      • [x] Imaginary flag
      • [ ] Compression via integer demotion (at writing)
    • [x] 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.

KovacsGG avatar Aug 10 '22 21:08 KovacsGG

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

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

KovacsGG avatar Aug 12 '22 02:08 KovacsGG

@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.

VivekTRamamoorthy avatar Aug 19 '22 12:08 VivekTRamamoorthy