Commit Graph

2 Commits

Author SHA1 Message Date
William S Fulton 059e7c16b3 cdata.i tests: remove macOS skips and tidy up
With the one-byte overflow fixed, the li_cdata_bytes tests no longer
corrupt the heap, so the macOS skips - added because free() crashed
"occasionally" - can be removed.

- Remove the Darwin skips from the Perl, Python and Ruby li_cdata_bytes
  runme files; the Ruby skip was also pinned to one exact Ruby version.
- Python runme: skip via an early sys.exit() on Python 2 rather than
  wrapping the whole body in a conditional, which previously made the
  test pass without running anything.
- Few other minor cleanups.
2026-05-25 13:17:29 +01:00
Erez Geva cd569d122a cdata.i changes and new test li_cdata_bytes
Fix guile cdata.

Add SWIG_BINSTR flag
- Add SWIG_FromBinCharPtrAndSize with the new flag
  To add languages that use Lib/cdata.i.
- python use binary string by using the new SWIG_BINSTR
  in SWIG_AsCharPtrAndSize and SWIG_FromBinCharPtrAndSize.

Languages that were changed to uses list
- Tcl use list of integers.
- scilab use list of uint8.
  And support passing list of numbers to C.

Add support to JavaScript
- use Uint8Array instead of strings.
- Add li_cdata_carrays. tests.
- Add li_cdata_bytes tests.
- Use Debian node-addon-api package location.
- napi folder location to Examples/test-suite/javascript/Makefile.in.
- Update documentation.

Update cdata.i documentation

This new cdata test focus on:
- Ensure we can receive proper data from C and pass proper data back to C.
- Use all possoble byte values , i.e. the full range of 0 to 255
  and ensure values 128 to 255 do not pass Unicode transformation (UTF-8/16).
- Ensure zero is a valid value and not a string null termination
  nor a modified UTF-8 which transform U+0000 to 0xC0 0x80.
- Check mutability of the cdata object.

Signed-off-by: Erez Geva <ErezGeva2@gmail.com>
2026-05-25 13:16:09 +01:00