示例#1
0
 def test_erase(self):
     myArf = ARF(dim=1, domain=32, min_range_size=4, size=9)
     myArf.insert_one_point(Point([1]))
     myArf.erase()
     assert myArf.get_bit_size() == 7, "Problem with erase"
示例#2
0
 def test_arf1_pile(self):
     arf1 = ARF(dim=2, domain=32, min_range_size=4)
     arf1.insert_one_point(Point([3, 5]))
     res = arf1.test_one_point(Point([3, 5]))
     self.assertEqual(res, True, "ARF test exact same value")
示例#3
0
 def test_arf_dim3_or(self):
     arf1 = ARF(dim=3, domain=32, min_range_size=4)
     arf1.insert_one_point(Point([3, 5, 3]))
     res, _ = arf1.test_set_of_points([[Point([3, 5, 3]), Point([8, 5, 3])]])
     self.assertEqual(res, [True], "Problem with ARF dim = 3")
示例#4
0
 def test_arf_dim4(self):
     arf1 = ARF(dim=4, domain=32, min_range_size=4)
     arf1.insert_one_point(Point([3, 5, 3, 5]))
     res, _ = arf1.test_set_of_points([[Point([3, 5, 3, 5])], [Point([7, 12, 3, 5])]])
     self.assertEqual(res, [True, False], "Problem with ARF dim = 4")
示例#5
0
 def test_arf_collision(self):
     arf1 = ARF(dim=2, domain=32, min_range_size=4)
     arf1.insert_one_point(Point([3, 5]))
     arf1.insert_one_point(Point([3, 5]))
     res = arf1.test_one_point(Point([3, 5]))
     self.assertEqual(res, True, "Problem with ARF with collision inside inputs")
示例#6
0
 def test_arf_mrs_1(self):
     arf1 = ARF(dim=2, domain=32, min_range_size=1)
     arf1.insert_one_point(Point([3, 5]))
     res = arf1.test_one_point(Point([3, 5]))
     self.assertEqual(res, True, "Problem with ARF with min range size = 1")
示例#7
0
 def test_arf1_almost(self):
     arf1 = ARF(dim=2, domain=32, min_range_size=4)
     arf1.insert_one_point(Point([3, 5]))
     res = arf1.test_one_point(Point([2, 6]))
     self.assertEqual(res, True, "ARF don't match on almost sames values")