def test_signModification_1(self): x = hamDb.explicitUnsignCast(5) x = hamDb.explicitSignCast(x) self.assertEqual(x, 5) tgtHash = -6076574518398440533 for hashVal in [data[1] for data in TEST_DATA]: x = hamDb.explicitUnsignCast(hashVal) x = hamDb.explicitSignCast(x) self.assertEqual(hashVal, x)
def test_signModification_2(self): for val in TEST_DATA_FLAT: tgtHash = b2i(val) x = hamDb.explicitUnsignCast(tgtHash) self.assertEqual(x, b2u(val)) x = hamDb.explicitSignCast(x) self.assertEqual(x, tgtHash)
def test_signModification_1(self): self.log.info("test_signModification_1") for val in TEST_DATA_Narrow: tgtHash = b2i(val) x = hamDb.explicitUnsignCast(tgtHash) self.assertEqual(x, b2u(val)) x = hamDb.explicitSignCast(x) self.assertEqual(x, tgtHash)
def test_signModification_3(self): random.seed(500000) for x in range(50000): val = "".join([random.choice(("1", "0")) for z in range(64)]) tgtHash = b2i(val) x = hamDb.explicitUnsignCast(tgtHash) self.assertEqual(x, b2u(val)) x = hamDb.explicitSignCast(x) self.assertEqual(x, tgtHash)