surpressed all style warnings from the LSP server.
This commit is contained in:
parent
7ee2238248
commit
23c4ac299e
13 changed files with 346 additions and 371 deletions
|
|
@ -19,25 +19,25 @@ public class BTreeFuzzTestStandardStrategy
|
|||
public void Fuzz_Insert_And_Remove_consistency()
|
||||
{
|
||||
// CONFIGURATION
|
||||
const int Iterations = 100_000; // High enough to trigger all splits/merges
|
||||
const int KeyRange = 5000; // Small enough to cause frequent collisions
|
||||
const int iterations = 100_000; // High enough to trigger all splits/merges
|
||||
const int keyRange = 5000; // Small enough to cause frequent collisions
|
||||
const bool showOps = false;
|
||||
int Seed = 2135974; // Environment.TickCount;
|
||||
int seed = 2135974; // Environment.TickCount;
|
||||
|
||||
// ORACLES
|
||||
var reference = new SortedDictionary<int, int>();
|
||||
var subject = BaseOrderedMap<int, int, StandardStrategy<int>>.CreateTransient(_strategy);
|
||||
|
||||
var random = new Random(Seed);
|
||||
_output.WriteLine($"Starting Fuzz Test with Seed: {Seed}");
|
||||
var random = new Random(seed);
|
||||
_output.WriteLine($"Starting Fuzz Test with Seed: {seed}");
|
||||
|
||||
try
|
||||
{
|
||||
for (int i = 0; i < Iterations; i++)
|
||||
for (int i = 0; i < iterations; i++)
|
||||
{
|
||||
// 1. Pick an Action: 70% Insert/Update, 30% Remove
|
||||
bool isInsert = random.NextDouble() < 0.7;
|
||||
int key = random.Next(KeyRange);
|
||||
int key = random.Next(keyRange);
|
||||
int val = key * 100;
|
||||
|
||||
if (isInsert)
|
||||
|
|
@ -82,7 +82,7 @@ public class BTreeFuzzTestStandardStrategy
|
|||
}
|
||||
catch (Exception)
|
||||
{
|
||||
_output.WriteLine($"FAILED at iteration with SEED: {Seed}");
|
||||
_output.WriteLine($"FAILED at iteration with SEED: {seed}");
|
||||
throw; // Re-throw to fail the test
|
||||
}
|
||||
}
|
||||
|
|
@ -91,28 +91,28 @@ public class BTreeFuzzTestStandardStrategy
|
|||
public void Fuzz_Range_Queries()
|
||||
{
|
||||
// Validates that your Range Enumerator matches LINQ on the reference
|
||||
const int Iterations = 1000;
|
||||
const int KeyRange = 2000;
|
||||
int Seed = Environment.TickCount;
|
||||
const int iterations = 1000;
|
||||
const int keyRange = 2000;
|
||||
int seed = Environment.TickCount;
|
||||
|
||||
var reference = new SortedDictionary<int, int>();
|
||||
var subject = BaseOrderedMap<int, int, StandardStrategy<int>>.CreateTransient(_strategy);
|
||||
var random = new Random(Seed);
|
||||
var random = new Random(seed);
|
||||
|
||||
// Fill Data
|
||||
for(int i=0; i<KeyRange; i++)
|
||||
for(int i=0; i<keyRange; i++)
|
||||
{
|
||||
int k = random.Next(KeyRange);
|
||||
int k = random.Next(keyRange);
|
||||
reference[k] = k;
|
||||
subject.Set(k, k);
|
||||
}
|
||||
|
||||
var persistent = subject.ToPersistent();
|
||||
|
||||
for (int i = 0; i < Iterations; i++)
|
||||
for (int i = 0; i < iterations; i++)
|
||||
{
|
||||
int min = random.Next(KeyRange);
|
||||
int max = min + random.Next(KeyRange - min); // Ensure max >= min
|
||||
int min = random.Next(keyRange);
|
||||
int max = min + random.Next(keyRange - min); // Ensure max >= min
|
||||
|
||||
// 1. Reference Result (LINQ)
|
||||
// Note: SortedDictionary doesn't have a direct Range query, so we filter memory.
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue