static object SimilarKeysTest() { var table = new HshdTbl(1); table.PutPair("a", 89999); table.PutPair("a", 1); return((int)table.GetValueByKey("a") == 1); }
static object ThreeElementsTest() { var table = new HshdTbl(3); table.PutPair("123", 1); table.PutPair("12", 51); table.PutPair("357", 235); return((int)table.GetValueByKey("357") == 235); }
static object HugeAndOneFindTest() { var tbl = new HshdTbl(10000); for (var i = 1; i <= tbl.Length; i++) { tbl.PutPair(i, i); } return((int)tbl.GetValueByKey(100) == 100); }
static object HugeAndFadedFindTest() { var tbl = new HshdTbl(1000000); for (var i = 1; i <= tbl.Length; i++) { tbl.PutPair(i, i * 2); } for (var i = tbl.Length + 1; i <= (tbl.Length * 1.2); i++) { if ((object)tbl.GetValueByKey(i) != null) { return(false); } } return(true); }