예제 #1
0
파일: TestPFD.py 프로젝트: pombredanne/pfd
 def test_find_first_target_2  (self) :        
     r = StringIO.StringIO("5 4\n3 2 1 5\n2 2 5 3\n4 1 3\n5 1 1")
     a = [0, 0]
     c = [0]
     b = pfd_initialize(r, a, c)
     matrix = getMatrix()
     pfd_find_first_target()
예제 #2
0
파일: TestPFD.py 프로젝트: pombredanne/pfd
 def test_find_first_target_3 (self) :
     r = StringIO.StringIO("2 1\n2 1 1")
     a = [0, 0]
     c = [0]
     b = pfd_initialize(r, a, c)
     matrix = getMatrix()
     pfd_find_first_target()
예제 #3
0
파일: TestPFD.py 프로젝트: pombredanne/pfd
 def test_clear_3 (self) :
     r = StringIO.StringIO("5 4\n3 2 1 5\n2 2 5 3\n4 1 3\n5 1 1")
     a = [0, 0]
     c = [0]
     b = pfd_initialize(r, a, c)
     matrix = getMatrix()
     self.assert_(b    == True)
     self.assert_(a[0] ==  5)
     self.assert_(a[1] ==  4)
     self.assert_(matrix == [[0, 0, 0, 0, 0],
                             [0, 0, 1, 0, 1],
                             [1, 0, 0, 0, 1],
                             [0, 0, 1, 0, 0],
                             [1, 0, 0, 0, 0]])
     pfd_clear(0)
     matrix = getMatrix()
     self.assert_(matrix == [[0, 0, 0, 0, 0],
                             [0, 0, 1, 0, 1],
                             [0, 0, 0, 0, 1],
                             [0, 0, 1, 0, 0],
                             [0, 0, 0, 0, 0]] )
     pfd_clear(4)
     matrix = getMatrix()
     self.assert_(matrix == [[0, 0, 0, 0, 0],
                             [0, 0, 1, 0, 0],
                             [0, 0, 0, 0, 0],
                             [0, 0, 1, 0, 0],
                             [0, 0, 0, 0, 0]] )
     pfd_clear(2)
     matrix = getMatrix()
     self.assert_(matrix == [[0, 0, 0, 0, 0],
                             [0, 0, 0, 0, 0],
                             [0, 0, 0, 0, 0],
                             [0, 0, 0, 0, 0],
                             [0, 0, 0, 0, 0]] )
예제 #4
0
파일: TestPFD.py 프로젝트: pombredanne/pfd
 def test_initialize_3 (self) :
     r = StringIO.StringIO("2 1\n2 1 1")
     a = [0, 0]
     c = [0]
     b = pfd_initialize(r, a, c)
     matrix = getMatrix()
     self.assert_(b    == True)
     self.assert_(a[0] ==  2)
     self.assert_(a[1] ==  1)
     self.assert_(matrix == [[0, 0],[1, 0]] )
예제 #5
0
파일: TestPFD.py 프로젝트: pombredanne/pfd
 def test_clear_2 (self) :
     r = StringIO.StringIO("2 1\n1 1 2")
     a = [0, 0]
     c = [0]
     b = pfd_initialize(r, a, c)
     matrix = getMatrix()
     self.assert_(b    == True)
     self.assert_(a[0] ==  2)
     self.assert_(a[1] ==  1)
     self.assert_(matrix == [[0, 1],[0, 0]] )
     pfd_clear(1)
     matrix = getMatrix()
     self.assert_(matrix == [[0, 0],[0, 0]] )