示例#1
0
 def test_objectCreation(self):
     intr = JavaCardVM(linkResolver())
     intr.load(javatest_cap)
     intr.frames.push(TestDummyFrame([None]))
     intr.new(2)
     intr.dup()
     intr.invokespecial(3)
     self._run(intr)  # dig into
     intr.invokevirtual(4)
     intr.returnn()
示例#2
0
 def test_objectCreation(self):
     intr = JavaCardVM(linkResolver())
     intr.load(javatest_cap)
     intr.frames.push(TestDummyFrame([None]))
     intr.new(2)
     intr.dup()
     intr.invokespecial(3)
     self._run(intr)  # dig into
     intr.invokevirtual(4)
     intr.returnn()
示例#3
0
 def test_callVirtualMethod(self):
     intr = JavaCardVM(linkResolver())
     intr.load(javatest_cap)
     intr.frames.push(TestDummyFrame([None]))
     intr.new(2)
     intr.dup()
     intr.invokespecial(3)
     self._run(intr)
     self.assertTrue(isinstance(intr.frame.stack[-1], Applet))
     for i in xrange(1, 4):
         intr.dup()
         intr.sspush(i)
         intr.invokevirtual(7)
         self._run(intr)
         self.assertEqual(i, intr.frame.stack[-1])
         intr.pop()
     intr.returnn()
示例#4
0
 def test_callVirtualMethod(self):
     intr = JavaCardVM(linkResolver())
     intr.load(javatest_cap)
     intr.frames.push(TestDummyFrame([None]))
     intr.new(2)
     intr.dup()
     intr.invokespecial(3)
     self._run(intr)
     self.assertTrue(isinstance(intr.frame.stack[-1], Applet))
     for i in xrange(1, 4):
         intr.dup()
         intr.sspush(i)
         intr.invokevirtual(7)
         self._run(intr)
         self.assertEqual(i, intr.frame.stack[-1])
         intr.pop()
     intr.returnn()