예제 #1
0
    @Test
    public void testCmplLongWithEqual() {
      TIntObjectMap<HeapItem> initial = VMTester.buildRegisterState(0, 0x100L, "J", 2, 0x100L, "J");
      TIntObjectMap<HeapItem> expected = VMTester.buildRegisterState(0, 0, "I");

      VMTester.testMethodState(CLASS_NAME, "CmpLong()V", initial, expected);
    }
예제 #2
0
    @Test
    public void testCmpgFloatWithEqual() {
      TIntObjectMap<HeapItem> initial = VMTester.buildRegisterState(0, 4.5F, "F", 1, 4.5F, "F");
      TIntObjectMap<HeapItem> expected = VMTester.buildRegisterState(0, 0, "I");

      VMTester.testMethodState(CLASS_NAME, "CmpgFloat()V", initial, expected);
    }
예제 #3
0
    @Test
    public void testCmplFloatWithGreaterThan() {
      TIntObjectMap<HeapItem> initial = VMTester.buildRegisterState(0, 20.5F, "F", 1, 0.5F, "F");
      TIntObjectMap<HeapItem> expected = VMTester.buildRegisterState(0, 1, "I");

      VMTester.testMethodState(CLASS_NAME, "CmplFloat()V", initial, expected);
    }
예제 #4
0
    @Test
    public void testCmpgDoubleWithEqual() {
      TIntObjectMap<HeapItem> initial = VMTester.buildRegisterState(0, 4.5D, "D", 2, 4.5D, "D");
      TIntObjectMap<HeapItem> expected = VMTester.buildRegisterState(0, 0, "I");

      VMTester.testMethodState(CLASS_NAME, "CmpgDouble()V", initial, expected);
    }
예제 #5
0
    @Test
    public void testCmplDoubleWithLessThan() {
      TIntObjectMap<HeapItem> initial = VMTester.buildRegisterState(0, 0.5D, "D", 2, 20.5D, "D");
      TIntObjectMap<HeapItem> expected = VMTester.buildRegisterState(0, -1, "I");

      VMTester.testMethodState(CLASS_NAME, "CmplDouble()V", initial, expected);
    }
예제 #6
0
    @Test
    public void testCmplLongWithUnknownArgument() {
      TIntObjectMap<HeapItem> initial =
          VMTester.buildRegisterState(0, 0x100L, "J", 2, new UnknownValue(), "J");
      TIntObjectMap<HeapItem> expected = VMTester.buildRegisterState(0, new UnknownValue(), "I");

      VMTester.testMethodState(CLASS_NAME, "CmpLong()V", initial, expected);
    }
예제 #7
0
    @Test
    public void testCmpgFloatWithUnknownArgment() {
      TIntObjectMap<HeapItem> initial =
          VMTester.buildRegisterState(0, 0.5F, "F", 1, new UnknownValue(), "F");
      TIntObjectMap<HeapItem> expected = VMTester.buildRegisterState(0, new UnknownValue(), "I");

      VMTester.testMethodState(CLASS_NAME, "CmpgFloat()V", initial, expected);
    }
예제 #8
0
 public static void testVisitation(
     String className, String methodSignature, VMState initialState, int[] expectedAddresses) {
   ExecutionGraph graph = VMTester.execute(className, methodSignature, initialState);
   testVisitation(graph, expectedAddresses);
 }