\seekquarry\yioop\testsBloomFilterFileTest

Used to test that the BloomFilterFile class provides the basic functionality of a persistent set. I.e., we can insert things into it, and we can do membership testing

Summary

Methods
Properties
Constants
__construct()
run()
assertTrue()
assertFalse()
assertEqual()
assertNotEqual()
setUp()
tearDown()
notInTestCase()
inTestCase()
saveLoadTestCase()
$test_case_results
$test_objects
case_name
No protected methods found
No protected properties found
N/A
No private methods found
No private properties found
N/A

Constants

case_name

case_name

The suffix that all TestCase methods need to have to be called by run()

Properties

$test_case_results

$test_case_results : 

Used to store the results for each test sub case

Type

$test_objects

$test_objects : array

Used to hold objects to be used in tests

Type

array

Methods

__construct()

__construct() 

Contructor should be overriden to do any set up that occurs before and test cases

run()

run() : array

Execute each of the test cases of this unit test and return the results

Returns

array —

test case results

assertTrue()

assertTrue(mixed  $x, string  $description = "") 

Checks that $x can coerced to true, the result of the test is added to $this->test_case_results

Parameters

mixed $x

item to check

string $description

information about this test subcase

assertFalse()

assertFalse(mixed  $x, string  $description = "") 

Checks that $x can coerced to false, the result of the test is added to $this->test_case_results

Parameters

mixed $x

item to check

string $description

information about this test subcase

assertEqual()

assertEqual(mixed  $x, mixed  $y, string  $description = "") 

Checks that $x and $y are the same, the result of the test is added to $this->test_case_results

Parameters

mixed $x

a first item to compare

mixed $y

a second item to compare

string $description

information about this test subcase

assertNotEqual()

assertNotEqual(mixed  $x, mixed  $y, string  $description = "") 

Checks that $x and $y are not the same, the result of the test is added to $this->test_case_results

Parameters

mixed $x

a first item to compare

mixed $y

a second item to compare

string $description

information about this test subcase

setUp()

setUp() 

Set up a bloom filter that can store up to 10 items and that saves itself every 100 writes

tearDown()

tearDown() 

Since a BloomFilterFile is a PersistentStructure it periodically saves itself to a file. To clean up we delete the files that might be created

notInTestCase()

notInTestCase() 

Tests that if nothing is in the bloom filter yet, that if we do a lookup we don't find anything

inTestCase()

inTestCase() 

Tests if we insert something into the bloom filter, that when we look it up, we find it. On the other hand, if we look something else up that we didn't insert, we shouldn't find it

saveLoadTestCase()

saveLoadTestCase() 

Check that if we force save the bloom filter file and then we reload it back in that it has the same Contents