예제 #1
0
	def testIntersect1(self):
		info1 = pathinformation.PathInformation()
		info1.union(self.a, self.an)
		self.assert_(info1.mustAlias(self.a, self.an))
		self.assert_(info1.mustAlias(self.a, self.ann))


		info2 = pathinformation.PathInformation()
		info2.union(self.a, self.ann)
		self.assert_(not info2.mustAlias(self.a, self.an))
		self.assert_(info2.mustAlias(self.a, self.ann))


		info3, changed = info1.inplaceMerge(info2)

		self.assert_(changed)
		self.assert_(not info3.mustAlias(self.a, self.an))
		self.assert_(info3.mustAlias(self.a, self.ann))

		info3, changed = info3.inplaceMerge(info1)
		self.assert_(not changed)
		self.assert_(not info3.mustAlias(self.a, self.an))
		self.assert_(info3.mustAlias(self.a, self.ann))

		info3, changed = info3.inplaceMerge(info2)
		self.assert_(not changed)
		self.assert_(not info3.mustAlias(self.a, self.an))
		self.assert_(info3.mustAlias(self.a, self.ann))
예제 #2
0
	def makeBase(self):
		paths = pathinformation.PathInformation()
		paths.union(self.xf, self.yrl)
		paths.union(self.yr, self.zf)
		paths.union(self.t, self.y)
		paths.inplaceUnionHitMiss((self.xf,), None)
		return paths
예제 #3
0
	def testTricky2(self):
		info = pathinformation.PathInformation()
		info.union(self.an, self.ann)
		info.union(self.dn, self.dnn)

		info.union(self.an, self.bn)
		info.union(self.cn, self.dn)
		info.union(self.b, self.c)

		self.assert_(not info.mustAlias(self.a, self.b))
		self.assert_(info.mustAlias(self.b, self.c))
		self.assert_(not info.mustAlias(self.c, self.d))

		self.assert_(info.mustAlias(self.an, self.bn))
		self.assert_(info.mustAlias(self.an, self.cn))
		self.assert_(info.mustAlias(self.an, self.dn))
		self.assert_(info.mustAlias(self.bn, self.cn))
		self.assert_(info.mustAlias(self.bn, self.dn))
		self.assert_(info.mustAlias(self.cn, self.dn))

		self.assert_(info.mustAlias(self.an, self.ann))
		self.assert_(info.mustAlias(self.bn, self.bnn))
		self.assert_(info.mustAlias(self.cn, self.cnn))
		self.assert_(info.mustAlias(self.dn, self.dnn))

		self.assert_(info.mustAlias(self.an, self.bnn))
예제 #4
0
	def testLoop(self):
		info = pathinformation.PathInformation()
		info.union(self.a, self.an)
		self.assert_(not info.mustAlias(self.a, self.b))
		self.assert_(not info.mustAlias(self.an, self.bn))

		self.assert_(info.mustAlias(self.a, self.an))
		self.assert_(info.mustAlias(self.an, self.ann))
예제 #5
0
	def testHits1(self):
		# Makes sure that if the canonical hit is eliminated,
		# another one takes its place.
		info = pathinformation.PathInformation()
		info = info.unionHitMiss((self.an,self.bn), ())

		filtera = info.filterUnstable(self.a.slot)
		self.assertEqual(filtera.hit(self.an), TVLMaybe)
		self.assertEqual(filtera.hit(self.bn), TVLTrue)

		filterb = info.filterUnstable(self.b.slot)
		self.assertEqual(filterb.hit(self.an), TVLTrue)
		self.assertEqual(filterb.hit(self.bn), TVLMaybe)
예제 #6
0
	def testHits2(self):
		# Makes sure that if the canonical hit is eliminated,
		# another one takes its place.

		info = pathinformation.PathInformation()
		info.union(self.a, self.b)
		self.assert_(info.mustAlias(self.a, self.b))
		self.assert_(info.mustAlias(self.an, self.bn))

		info = info.unionHitMiss((self.an,), ())
		self.assert_(info.mustAlias(self.a, self.b))
		self.assert_(info.mustAlias(self.an, self.bn))

		self.assertEqual(info.hit(self.an), TVLTrue)
		self.assertEqual(info.hit(self.bn), TVLTrue)
예제 #7
0
	def makeBase(self):
		paths = pathinformation.PathInformation()
		paths.union(self.xl, self.yr)
		paths.inplaceUnionHitMiss((self.xlrr,), None)
		return paths