private void construct_valid_cache_for_any_combination_of_params(int maxIndexEntries)
        {
            var rnd = new Random(123987);

            for (int count = 0; count < maxIndexEntries; ++count)
            {
                for (int depth = 0; depth < 15; ++depth)
                {
                    PTable ptable = null;
                    try
                    {
                        Log.Trace("Creating PTable with count {0}, depth {1}", count, depth);
                        ptable = ConstructPTable(GetFilePathFor(string.Format("{0}-{1}-indexv{2}.ptable", count, depth, _ptableVersion)), count, rnd, depth);
                        ValidateCache(ptable.GetMidPoints(), count, depth);
                    }
                    finally
                    {
                        if (ptable != null)
                        {
                            ptable.Dispose();
                        }
                    }
                }
            }
        }
Пример #2
0
        public void construct_valid_cache_for_any_combination_of_params()
        {
            var rnd = new Random(123987);

            for (int count = 0; count < 4096; ++count)
            {
                PTable ptable = null;
                try
                {
                    Log.Trace("Creating PTable with count {0}", count);
                    ptable = ConstructPTable(GetFilePathFor(string.Format("{0}.ptable", count)), count, rnd);

                    for (int depth = 0; depth < 15; ++depth)
                    {
                        ValidateCache(ptable.GetMidPoints(), count, depth);
                    }
                }
                finally
                {
                    if (ptable != null)
                    {
                        ptable.MarkForDestruction();
                    }
                }
            }
        }
Пример #3
0
 public void correct_number_of_midpoints_are_loaded()
 {
     Assert.AreEqual(_newtable.GetMidPoints().Length,
                     PTable.GetRequiredMidpointCountCached(14, PTableVersions.IndexV4));
 }