mirror of
https://github.com/google/flatbuffers.git
synced 2026-07-04 01:54:13 +00:00
Ported some of the python fuzz tests to C#
* Refactored the test runner to use attribute based test discovery * Ported value and vtable/object fuzzing tests from python to C#
This commit is contained in:
26
tests/FlatBuffers.Test/Lcg.cs
Normal file
26
tests/FlatBuffers.Test/Lcg.cs
Normal file
@@ -0,0 +1,26 @@
|
||||
namespace FlatBuffers.Test
|
||||
{
|
||||
/// <summary>
|
||||
/// Lcg Pseudo RNG
|
||||
/// </summary>
|
||||
internal sealed class Lcg
|
||||
{
|
||||
private const uint InitialValue = 10000;
|
||||
private uint _state;
|
||||
|
||||
public Lcg()
|
||||
{
|
||||
_state = InitialValue;
|
||||
}
|
||||
|
||||
public uint Next()
|
||||
{
|
||||
return (_state = 69069 * _state + 362437);
|
||||
}
|
||||
|
||||
public void Reset()
|
||||
{
|
||||
_state = InitialValue;
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user