Examples of SwitchData


Examples of com.android.dx.dex.code.SwitchData

      }
      else if (instructions.get(i) instanceof SwitchData)
      {
        // If a switch-statement is enclosed by a try-block, we
        // will also require splitting.
        SwitchData switchData= (SwitchData) instructions.get(i);
        CodeAddress[] caseTargets= switchData.getTargets();
        for (CodeAddress caseTarget : caseTargets)
        {
          targets.put(caseTarget.getAddress(), new Target(caseTarget.getAddress(), true));
        }
      }
View Full Code Here

Examples of com.android.dx.dex.code.SwitchData

    Map<Integer, SwitchData> result= new HashMap<Integer, SwitchData>();
    for (int i= 0; i < instructions.size(); ++i)
    {
      if (instructions.get(i) instanceof SwitchData)
      {
        SwitchData switchData= (SwitchData) instructions.get(i);
        result.put(switchData.getAddress(), switchData);
      }
    }
    return result;
  }
View Full Code Here

Examples of com.android.dx.dex.code.SwitchData

      dexInstruction= new Element(sanitizeInstructionName(instructionName), NS_DEX);
      addRegistersAsAttributes(targetInsn.getRegisters(), dexInstruction);

      if (instructionName.equals("packed-switch") || instructionName.equals("sparse-switch"))
      {
        SwitchData switchData= switchDataBlocks.get(targetInsn.getTargetAddress());
        if (switchData == null)
        {
          Log.error(TAG, "DEXmlvmOutputProcess: Couldn't find SwitchData block.");
          System.exit(-1);
        }
        IntList cases= switchData.getCases();
        CodeAddress[] caseTargets= switchData.getTargets();

        // Sanity check.
        if (cases.size() != caseTargets.length)
        {
          Log.error(TAG, "DEXmlvmOutputProcess: SwitchData size mismatch: cases vs targets.");
View Full Code Here

Examples of net.sourceforge.cobertura.coveragedata.SwitchData

                        ArrayList<Long> result = new ArrayList<Long>();
                        if (ld.hasBranch()) {
                            for (int i = 0; i < ld.getConditionSize(); i++) {
                                Object xcd = ld.getConditionData(i);
                                if (xcd instanceof SwitchData) {
                                    SwitchData sd = (SwitchData) xcd;
                                    for (int j = 0; j < sd
                                            .getNumberOfValidBranches() - 1; j++) {
                                        result.add(sd.getHits(j));
                                    }
                                    result.add(sd.getDefaultHits());
                                } else {
                                    JumpData jd = (JumpData) xcd;
                                    result.add(jd.getTrueHits());
                                    result.add(jd.getFalseHits());
                                }
View Full Code Here

Examples of net.sourceforge.cobertura.coveragedata.SwitchData

                                + "true from " + prevTrue + " by "
                                + diffTrueHits + ", false from " + prevFalse
                                + " by " + diffFalseHits);
                    }
                } else if (cd instanceof SwitchData) {
                    SwitchData lsd = (SwitchData) cd;
                    result.addLineSwitch(lld.getLineNumber(), i, 0, 0, lsd.getMaxBranches());
                    long[] prevBranchHits = new long[lsd
                            .getNumberOfValidBranches() - 1];
                    long prevDefaultHits = 0;
                    if (smaller != null) {
                        LineData sld = smaller.getLineCoverage(lld
                                .getLineNumber());
                        if (sld != null) {
                            SwitchData ssd = (SwitchData) sld
                                    .getConditionData(i);
                            if (ssd != null) {
                                for (int j = 0; j < prevBranchHits.length; j++) {
                                    // returns -1 on an error condition.
                                    // probably never happens in normal
                                    // situation, but does in unit test.
                                    prevBranchHits[j] = Math.max(0,
                                            ssd.getHits(j));
                                }
                                prevDefaultHits = ssd.getDefaultHits();
                            }
                        }
                    }
                    for (int j = 0; j < prevBranchHits.length; j++) {
                        long diffBranchHits = lsd.getHits(j)
View Full Code Here

Examples of net.sourceforge.cobertura.coveragedata.SwitchData

        for (int i = 0; i < 3; i++) {
            LineData x = bar.getLineCoverage(i);
            assertEquals(x.getHits(), 0);
            assertEquals(x.hasBranch(), i == 2, "Switches for " + i);
            if (x.hasBranch()) {
                SwitchData sd = (SwitchData) x.getConditionData(0);
                assertEquals(1, sd.getDefaultHits());
                assertEquals(0, sd.getHits(0));
                assertEquals(0, sd.getHits(1));
                assertEquals(1, sd.getHits(2));

            }
        }
        ClassData baz = diff.getClassData("baz");
        assertEquals(8, baz.getLines().size());
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.