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()
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()