forked from BigfootDev/flatbuffers
* Correction of bug inside ToArray<T> methods Avoid allocating too large buffers (len is expressed in bytes, not in Ts). Added validation to ensure len is a multiple of SizeOf<T>() before converting to array. * Update ByteBuffer.cs * Refactor ToArray and ToArrayPadded methods I understand from failed test that pos, len, padLeft and padRight are expressed in Ts * Refactor ToArray and ToArrayPadded methods * Final correction All functions parameters expressed in bytes for homogeneity Tests run: - UNSAFE_BYTEBUFFER=true/ENABLE_SPAN_T=true: passed - UNSAFE_BYTEBUFFER=true/ENABLE_SPAN_T=false: passed - UNSAFE_BYTEBUFFER=false/ENABLE_SPAN_T=false: passed - UNSAFE_BYTEBUFFER=false/ENABLE_SPAN_T=true: configuration forbidden by compilation Correction of FlatBuffers.Test.csproj to allow UNSAFE_BYTEBUFFER/ENABLE_SPAN_T tests Correction of FlatBuffersExampleTests.cs: I think the test was not run because it could not pass (to be reviewed carefully)
.NET Tests
Running on Linux
Prerequisites
To run the tests on a Linux a few prerequisites are needed:
- mono
- msbuild
Running
To run the tests:
./NetTest.sh
This will download the .NET installer and core SDK if those are not already
installed. Then it will build the tests using msbuild and run the resulting
test binary with mono.
After running the tests, the downloaded .NET installer and SDK are not removed as they can be reused in subsequent invocations. The files are ignored by git by default, and can remain in the working directory.
Cleaning
If you want to clean up the downloaded .NET installer and SDK, run:
./clean.sh
This will wipe away the downloaded files and directories. Those will be
automatically re-downloaded when running NetTest.sh.