181
181
newseed &= RandomBit * 2 - 1;
182
182
if (newseed == FirstSeed)
184
printf("End of LFSR, Total Population = %lu (0x%lx)\n", TotalPop, TotalPop);
184
printf("Passed (End of LFSR) Judy1, JudyL, JudyHS tests for %lu numbers with <= %ld bits\n", TotalPop, BValue);
512
512
FAILURE("Judy1Set failed - DUP Index, population =", TotalPop);
515
Rcode = Judy1Test(*J1, TstIndex);
514
517
J1T(Rcode, *J1, TstIndex);
516
520
FAILURE("Judy1Test failed - Index missing, population =", TotalPop);
529
533
// Save Index in Value
530
534
*PValue = TstIndex;
537
PValue1 = (PWord_t)JudyLGet(*JL, TstIndex);
532
539
JLG(PValue1, *JL, TstIndex);
533
541
if (PValue != PValue1)
534
542
FAILURE("JudyLGet failed - Index missing, population =", TotalPop);
602
610
if (TstIndex < LowIndex)
603
611
LowIndex = TstIndex;
614
Rcode = Judy1Test(J1, TstIndex);
605
616
J1T(Rcode, J1, TstIndex);
607
619
FAILURE("Judy1Test Rcode != 1", Rcode);
622
PValue = (PWord_t)JudyLGet(JL, TstIndex);
609
624
JLG(PValue, JL, TstIndex);
610
626
if (PValue == (Word_t *) NULL)
611
627
FAILURE("JudyLGet ret PValue = NULL", 0L);
612
628
if (*PValue != TstIndex)
704
720
if (CountL == JERR)
705
721
FAILURE("JudyLCount ret JERR", CountL);
707
if (CountL != (elm + 1)) FAILURE("JLC at", elm);
723
if (CountL != (elm + 1))
725
printf("CountL = %lu, elm +1 = %lu\n", CountL, elm + 1);
726
FAILURE("JLC at", elm);
709
729
J1N(Rcode, J1, TstIndex);
736
756
if (JLindex != J1index)
737
757
FAILURE("JudyLNext & Judy1Next ret different PIndex at", elm);
759
JPindex = J1index; // save the last found index
739
761
JLN(PValue, JL, JLindex); // Get next one
740
762
J1N(Rcode, J1, J1index); // Get next one
833
if (pFlag) { printf("JNE: %8lu\t0x%lx\n", elm, JLindex); }
810
835
// Find next Empty Index, JLindex is modified by JLNE
811
JLNE(Rcode, JL, JLindex); // Rcode = JudyLNextEmpty(JL, &JLindex, PJE0)
813
FAILURE("JudyLNextEmpty Rcode != 1 =", Rcode);
815
if (pFlag) { printf("JNE: %8lu\t0x%lx\n", elm, JLindex); }
836
JLNE(RcodeL, JL, JLindex); // Rcode = JudyLNextEmpty(JL, &JLindex, PJE0)
817
838
// Find next Empty Index, J1index is modified by J1NE
818
J1NE(Rcode, J1, J1index); // Rcode = Judy1NextEmpty(J1, &J1index, PJE0)
820
FAILURE("Judy1NextEmpty Rcode != 1 =", Rcode);
839
J1NE(Rcode1, J1, J1index); // Rcode = Judy1NextEmpty(J1, &J1index, PJE0)
840
if ((Rcode1 != 1) || (RcodeL != 1))
842
printf("RcodeL = %d, Rcode1 = %d, Index1 = 0x%lx, IndexL = 0x%lx\n",
843
RcodeL, Rcode1, J1index, JLindex);
844
FAILURE("Judy1NextEmpty Rcode != 1 =", Rcode1);
822
847
if (J1index != JLindex)
823
848
FAILURE("JLNE != J1NE returned index at", elm);
825
J1T(Rcode, J1, J1index);
850
Rcode1 = Judy1Test(J1, J1index);
852
J1T(Rcode1, J1, J1index);
827
855
FAILURE("J1NE returned non-empty Index =", J1index);
858
PValue = (PWord_t)JudyLGet(JL, JLindex);
829
860
JLG(PValue, JL, JLindex);
830
862
if (PValue != (Word_t *) NULL)
831
863
FAILURE("JLNE returned non-empty Index =", JLindex);
857
890
for (elm = 0; elm < Elements; elm++)
861
J1PE(Rcode, J1, J1index); // Rcode = Judy1PrevEmpty(J1, &J1index, PJE0)
863
FAILURE("Judy1PrevEmpty Rcode != 1 =", Rcode);
865
if (pFlag) { printf("JPE: %8lu\t0x%lx\n", elm, J1index); }
897
if (pFlag) { printf("JPE: %8lu\t0x%lx\n", elm, JPIndex); }
899
J1PE(Rcode1, J1, J1index); // Rcode = Judy1PrevEmpty(J1, &J1index, PJE0)
867
901
// Find next Empty Index, JLindex is modified by JLPE
868
JLPE(Rcode, JL, JLindex); // Rcode = JudyLPrevEmpty(JL, &JLindex, PJE0)
870
FAILURE("JudyLPrevEmpty Rcode != 1 =", Rcode);
902
JLPE(RcodeL, JL, JLindex); // RcodeL = JudyLPrevEmpty(JL, &JLindex, PJE0)
903
if ((RcodeL != 1) || (Rcode1 != 1))
905
printf("RcodeL = %d, Rcode1 = %d, Index1 = 0x%lx, IndexL = 0x%lx\n",
906
RcodeL, Rcode1, J1index, JLindex);
907
FAILURE("Judy*PrevEmpty Rcode* != 1 =", RcodeL);
872
910
if (J1index != JLindex)
873
911
FAILURE("JLPE != J1PE returned index at", elm);
875
J1T(Rcode, J1, J1index);
914
Rcode1 = Judy1Test(J1, J1index);
916
J1T(Rcode1, J1, J1index);
877
919
FAILURE("J1PE returned non-empty Index =", J1index);
922
PValue = (PWord_t)JudyLGet(JL, JLindex);
879
924
JLG(PValue, JL, JLindex);
880
926
if (PValue != (Word_t *) NULL)
881
927
FAILURE("JLPE returned non-empty Index =", JLindex);