Ejemplo n.º 1
0
	def test_addEmpties_4 (self) :
		index = -1
		avail = []
		numDep = [0, 0, 5, 0, 0, 2, 0, 2, 0]
		count = pfd_addEmpties(index, avail, numDep)
		self.assert_(index == -1)
		self.assert_(str(avail) == "[1, 3, 4, 6, 8]")
		self.assert_(str(numDep) == "[0, -1, 5, -1, -1, 2, -1, 2, -1]")
		self.assert_(count == 5)
Ejemplo n.º 2
0
	def test_addEmpties_3 (self) :
		index = 1
		avail = []
		numDep = [0, 0]
		count = pfd_addEmpties(index, avail, numDep)
		self.assert_(index == 1)
		self.assert_(str(avail) == "[1]")
		self.assert_(str(numDep) == "[0, -1]")
		self.assert_(count == 1)
Ejemplo n.º 3
0
	def test_addEmpties_2 (self) :
		index = 4
		avail = []
		numDep = [0, 2, 2, 1, 0]
		count = pfd_addEmpties(index, avail, numDep)
		self.assert_(index == 4)
		self.assert_(str(avail) == "[4]")
		self.assert_(str(numDep) == "[0, 2, 2, 1, -1]")
		self.assert_(count == 1)
Ejemplo n.º 4
0
 def test_addEmpties_4(self):
     index = -1
     avail = []
     numDep = [0, 0, 5, 0, 0, 2, 0, 2, 0]
     count = pfd_addEmpties(index, avail, numDep)
     self.assert_(index == -1)
     self.assert_(str(avail) == "[1, 3, 4, 6, 8]")
     self.assert_(str(numDep) == "[0, -1, 5, -1, -1, 2, -1, 2, -1]")
     self.assert_(count == 5)
Ejemplo n.º 5
0
 def test_addEmpties_3(self):
     index = 1
     avail = []
     numDep = [0, 0]
     count = pfd_addEmpties(index, avail, numDep)
     self.assert_(index == 1)
     self.assert_(str(avail) == "[1]")
     self.assert_(str(numDep) == "[0, -1]")
     self.assert_(count == 1)
Ejemplo n.º 6
0
 def test_addEmpties_2(self):
     index = 4
     avail = []
     numDep = [0, 2, 2, 1, 0]
     count = pfd_addEmpties(index, avail, numDep)
     self.assert_(index == 4)
     self.assert_(str(avail) == "[4]")
     self.assert_(str(numDep) == "[0, 2, 2, 1, -1]")
     self.assert_(count == 1)