mirror of
https://github.com/google/flatbuffers.git
synced 2026-06-26 18:32:41 +00:00
Fix verification for C# unions (#7970)
* Fix verification for unions * Run scripts\generate_code.py --------- Co-authored-by: Michael Le <michael.le647@gmail.com>
This commit is contained in:
@@ -99,6 +99,26 @@ namespace Google.FlatBuffers.Test
|
||||
}
|
||||
}
|
||||
|
||||
public static void ArrayEqual<T>(ArraySegment<T> expected, T[] actual)
|
||||
{
|
||||
#if NETCOREAPP
|
||||
ArrayEqual(expected.ToArray(), actual);
|
||||
#else
|
||||
if (expected.Count != actual.Length)
|
||||
{
|
||||
throw new AssertFailedException(expected, actual);
|
||||
}
|
||||
|
||||
for (var i = 0; i < expected.Count; ++i)
|
||||
{
|
||||
if (!expected.Array[expected.Offset + i].Equals(actual[i]))
|
||||
{
|
||||
throw new AssertArrayFailedException(i, expected, actual);
|
||||
}
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
public static void IsTrue(bool value)
|
||||
{
|
||||
if (!value)
|
||||
|
||||
Reference in New Issue
Block a user