def test_reserve(self): """ Verifies that reserve causes no runtime errors. reserve is only used to manipulate the underlying RBC layer which is not exposed """ mgr = BeRbcManager.with_capacity(10) # cannot be verified w/o exposing RBC internals # (which makes little sense since BE already offers a sufficient # abstraction) mgr.reserve(12)
def test_reset(self): """ Verifies that resetting the cache provokes no error -> verifies only the absence of runtime errors since it is who RBC does the heavy lifting, not the manager """ mgr = BeRbcManager.with_capacity(10) # test it doesn't hurt to call this method even though nothing is to # be done. mgr.reset() # conversion to CNF populates the hashes which are being reset so # using this manager to perform cnf conversion makes sense if we want # to test the reset works when it actually does something. (Be.true(mgr) and Be.false(mgr)).to_cnf(Polarity.POSITIVE) mgr.reset()
def test_with_capacity(self): """This test verifies that no memory exception etc.. occur""" mgr = BeRbcManager.with_capacity(10) self.assertIsNotNone(mgr, "mgr should be defined") self.assertTrue(mgr._freeit) self.assertIsNotNone(mgr._ptr, "mgr _ptr should be defined")