prepare for unit tests
This commit is contained in:
parent
5a9ac804a2
commit
9f21bf5d1d
14
pom.xml
14
pom.xml
|
@ -32,4 +32,18 @@
|
||||||
</plugins>
|
</plugins>
|
||||||
</build>
|
</build>
|
||||||
|
|
||||||
|
<dependencies>
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.junit.jupiter</groupId>
|
||||||
|
<artifactId>junit-jupiter-api</artifactId>
|
||||||
|
<version>5.3.0</version>
|
||||||
|
<scope>test</scope>
|
||||||
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.junit.jupiter</groupId>
|
||||||
|
<artifactId>junit-jupiter-engine</artifactId>
|
||||||
|
<version>5.3.0</version>
|
||||||
|
<scope>test</scope>
|
||||||
|
</dependency>
|
||||||
|
</dependencies>
|
||||||
</project>
|
</project>
|
|
@ -449,27 +449,6 @@ public class BinHex4InputStream extends InputStream {
|
||||||
return (fl1 << 8) | fl2;
|
return (fl1 << 8) | fl2;
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void main(String[] args)
|
|
||||||
{
|
|
||||||
try (BinHex4InputStream in = new BinHex4InputStream(System.in)) {
|
|
||||||
System.err.println(in.getHeader());
|
|
||||||
|
|
||||||
byte[] buf = new byte[1024];
|
|
||||||
|
|
||||||
System.err.println("Starting to convert");
|
|
||||||
while(true)
|
|
||||||
{
|
|
||||||
int r = in.read(buf);
|
|
||||||
if(r <= 0)
|
|
||||||
return;
|
|
||||||
System.out.write(buf, 0, r);
|
|
||||||
}
|
|
||||||
} catch(IOException e)
|
|
||||||
{
|
|
||||||
e.printStackTrace();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
One of three states: before header, in data fork, or in resource fork.
|
One of three states: before header, in data fork, or in resource fork.
|
||||||
*/
|
*/
|
||||||
|
|
|
@ -298,26 +298,6 @@ public class Hqx7_to_Hqx8InputStream extends FilterInputStream {
|
||||||
return len;
|
return len;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public static void main(String[] args)
|
|
||||||
{
|
|
||||||
try (InputStream in = new Hqx7_to_Hqx8InputStream(System.in)) {
|
|
||||||
byte[] buf = new byte[1024];
|
|
||||||
|
|
||||||
System.err.println("Starting to convert");
|
|
||||||
while(true)
|
|
||||||
{
|
|
||||||
int r = in.read(buf);
|
|
||||||
if(r <= 0)
|
|
||||||
return;
|
|
||||||
System.out.write(buf, 0, r);
|
|
||||||
}
|
|
||||||
} catch(IOException e)
|
|
||||||
{
|
|
||||||
e.printStackTrace();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
A buffer for a maximum of two times six bits.
|
A buffer for a maximum of two times six bits.
|
||||||
*/
|
*/
|
||||||
|
|
|
@ -254,26 +254,6 @@ public class RLE_CRCInputStream extends FilterInputStream {
|
||||||
return len;
|
return len;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public static void main(String[] args)
|
|
||||||
{
|
|
||||||
try (InputStream in = new RLE_CRCInputStream(System.in)) {
|
|
||||||
byte[] buf = new byte[1024];
|
|
||||||
|
|
||||||
System.err.println("Starting to convert");
|
|
||||||
while(true)
|
|
||||||
{
|
|
||||||
int r = in.read(buf);
|
|
||||||
if(r <= 0)
|
|
||||||
return;
|
|
||||||
System.out.write(buf, 0, r);
|
|
||||||
}
|
|
||||||
} catch(IOException e)
|
|
||||||
{
|
|
||||||
e.printStackTrace();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
True if private method nextDecodedByte is still repeating a character
|
True if private method nextDecodedByte is still repeating a character
|
||||||
that was part of a Run-Length Encoding sequence.
|
that was part of a Run-Length Encoding sequence.
|
||||||
|
|
|
@ -0,0 +1,48 @@
|
||||||
|
/*
|
||||||
|
* Copyright (c) 2019 by Naohide Sano, All rights reserved.
|
||||||
|
*
|
||||||
|
* Programmed by Naohide Sano
|
||||||
|
*/
|
||||||
|
|
||||||
|
package org.gjt.convert.binhex;
|
||||||
|
|
||||||
|
import java.io.IOException;
|
||||||
|
|
||||||
|
import org.junit.jupiter.api.Test;
|
||||||
|
|
||||||
|
import static org.junit.jupiter.api.Assertions.*;
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* BinHex4InputStreamTest.
|
||||||
|
*
|
||||||
|
* @author <a href="mailto:umjammer@gmail.com">Naohide Sano</a> (umjammer)
|
||||||
|
* @version 0.00 2019/06/11 umjammer initial version <br>
|
||||||
|
*/
|
||||||
|
class BinHex4InputStreamTest {
|
||||||
|
|
||||||
|
@Test
|
||||||
|
void test() {
|
||||||
|
fail("Not yet implemented");
|
||||||
|
}
|
||||||
|
|
||||||
|
public static void main(String[] args) {
|
||||||
|
try (BinHex4InputStream in = new BinHex4InputStream(System.in)) {
|
||||||
|
System.err.println(in.getHeader());
|
||||||
|
|
||||||
|
byte[] buf = new byte[1024];
|
||||||
|
|
||||||
|
System.err.println("Starting to convert");
|
||||||
|
while (true) {
|
||||||
|
int r = in.read(buf);
|
||||||
|
if (r <= 0)
|
||||||
|
return;
|
||||||
|
System.out.write(buf, 0, r);
|
||||||
|
}
|
||||||
|
} catch (IOException e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/* */
|
|
@ -0,0 +1,28 @@
|
||||||
|
/*
|
||||||
|
* Copyright (c) 2019 by Naohide Sano, All rights reserved.
|
||||||
|
*
|
||||||
|
* Programmed by Naohide Sano
|
||||||
|
*/
|
||||||
|
|
||||||
|
package org.gjt.convert.binhex;
|
||||||
|
|
||||||
|
import org.junit.jupiter.api.Test;
|
||||||
|
|
||||||
|
import static org.junit.jupiter.api.Assertions.*;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* DeBinHexTest.
|
||||||
|
*
|
||||||
|
* @author <a href="mailto:umjammer@gmail.com">Naohide Sano</a> (umjammer)
|
||||||
|
* @version 0.00 2019/06/11 umjammer initial version <br>
|
||||||
|
*/
|
||||||
|
class DeBinHexTest {
|
||||||
|
|
||||||
|
@Test
|
||||||
|
void test() {
|
||||||
|
fail("Not yet implemented");
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
/* */
|
|
@ -0,0 +1,47 @@
|
||||||
|
/*
|
||||||
|
* Copyright (c) 2019 by Naohide Sano, All rights reserved.
|
||||||
|
*
|
||||||
|
* Programmed by Naohide Sano
|
||||||
|
*/
|
||||||
|
|
||||||
|
package org.gjt.convert.binhex;
|
||||||
|
|
||||||
|
import java.io.IOException;
|
||||||
|
import java.io.InputStream;
|
||||||
|
|
||||||
|
import org.junit.jupiter.api.Test;
|
||||||
|
|
||||||
|
import static org.junit.jupiter.api.Assertions.*;
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Hqx7_to_Hqx8InputStreamTest.
|
||||||
|
*
|
||||||
|
* @author <a href="mailto:umjammer@gmail.com">Naohide Sano</a> (umjammer)
|
||||||
|
* @version 0.00 2019/06/11 umjammer initial version <br>
|
||||||
|
*/
|
||||||
|
class Hqx7_to_Hqx8InputStreamTest {
|
||||||
|
|
||||||
|
@Test
|
||||||
|
void test() {
|
||||||
|
fail("Not yet implemented");
|
||||||
|
}
|
||||||
|
|
||||||
|
public static void main(String[] args) {
|
||||||
|
try (InputStream in = new Hqx7_to_Hqx8InputStream(System.in)) {
|
||||||
|
byte[] buf = new byte[1024];
|
||||||
|
|
||||||
|
System.err.println("Starting to convert");
|
||||||
|
while (true) {
|
||||||
|
int r = in.read(buf);
|
||||||
|
if (r <= 0)
|
||||||
|
return;
|
||||||
|
System.out.write(buf, 0, r);
|
||||||
|
}
|
||||||
|
} catch (IOException e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/* */
|
|
@ -0,0 +1,47 @@
|
||||||
|
/*
|
||||||
|
* Copyright (c) 2019 by Naohide Sano, All rights reserved.
|
||||||
|
*
|
||||||
|
* Programmed by Naohide Sano
|
||||||
|
*/
|
||||||
|
|
||||||
|
package org.gjt.convert.binhex;
|
||||||
|
|
||||||
|
import java.io.IOException;
|
||||||
|
import java.io.InputStream;
|
||||||
|
|
||||||
|
import org.junit.jupiter.api.Test;
|
||||||
|
|
||||||
|
import static org.junit.jupiter.api.Assertions.*;
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* RLE_CRCInputStreamTest.
|
||||||
|
*
|
||||||
|
* @author <a href="mailto:umjammer@gmail.com">Naohide Sano</a> (umjammer)
|
||||||
|
* @version 0.00 2019/06/11 umjammer initial version <br>
|
||||||
|
*/
|
||||||
|
class RLE_CRCInputStreamTest {
|
||||||
|
|
||||||
|
@Test
|
||||||
|
void test() {
|
||||||
|
fail("Not yet implemented");
|
||||||
|
}
|
||||||
|
|
||||||
|
public static void main(String[] args) {
|
||||||
|
try (InputStream in = new RLE_CRCInputStream(System.in)) {
|
||||||
|
byte[] buf = new byte[1024];
|
||||||
|
|
||||||
|
System.err.println("Starting to convert");
|
||||||
|
while (true) {
|
||||||
|
int r = in.read(buf);
|
||||||
|
if (r <= 0)
|
||||||
|
return;
|
||||||
|
System.out.write(buf, 0, r);
|
||||||
|
}
|
||||||
|
} catch (IOException e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/* */
|
Loading…
Reference in New Issue