IPS extends Patcher { @Override public void apply(boolean ignoreChecksum) throws PatchException, IOException { apply(); } IPS(Context context, File patch, File rom, File output); @Override void apply(boolean ignoreChecksum); void apply(); static final int NOT_IPS_PATCH; static final int IPS_PATCH; static final int IPS32_PATCH; }
@Test public void IPS_InvalidPatch_NoMagic() throws Exception { File patch = new File(this.getClass().getResource("/ips/not_ips.ips").getPath()); File in = new File(getClass().getResource("/ips/min_ips.bin").getPath()); File out = folder.newFile("out.bin"); IPS patcher = new IPS(mockContext, patch, in, out); try { patcher.apply(); fail("Expected an PatchException to be thrown"); } catch (PatchException e) { assertThat(e.getMessage(), is("Not an IPS patch.")); } }