コード例 #1
0
  @Override
  public void prepare(TestCase testCase) {
    String name = testCase.getName();

    String[] parts = name.split(":");
    if (parts.length < 2) {
      throw new IllegalArgumentException(
          "Invalid test name '" + name + "'; should have at least 2 components separated by slash");
    }
    _operation = null;
    String operStr = parts[0];
    String filename = parts[1];
    if (operStr.startsWith("C")) {
      _operation = Operation.COMPRESS;
    } else if (operStr.startsWith("U")) {
      _operation = Operation.UNCOMPRESS;
    } else if (operStr.startsWith("R")) {
      _operation = Operation.ROUNDTRIP;
    } else {
      throw new IllegalArgumentException(
          "Invalid 'operation' part of name, '" + operStr + "': should start with 'C', 'U' or 'R'");
    }
    _inputFile = new File(_inputDir, filename);
    try {
      // First things first: load uncompressed input in memory; compress to verify round-tripping
      _uncompressed = loadFile(_inputFile);
      _compressed = compressBlock(_uncompressed);
      verifyRoundTrip(testCase.getName(), _uncompressed, _compressed);
    } catch (RuntimeException e) {
      throw e;
    } catch (Exception e) {
      throw new RuntimeException(e);
    }
  }
コード例 #2
0
  @Override
  public void finish(TestCase testCase) {

    assertEquals(0, clearVM());
    if (testCase.getName().equals("test12")) {
      System.out.println("warmups: ");
      for (int j = 0; j < TN; j++)
        for (int i = 0; i < WC; i += 1) {
          System.out.println(warmups[j][i]);
        }
    }
  }