-
-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
821ceaf
commit 739932e
Showing
6 changed files
with
42 additions
and
376 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,31 +1,25 @@ | ||
package ru.r2cloud.jradio.usp; | ||
|
||
import java.io.DataInputStream; | ||
import java.io.EOFException; | ||
import java.io.IOException; | ||
|
||
import org.junit.Test; | ||
|
||
import ru.r2cloud.jradio.AssertJson; | ||
import ru.r2cloud.jradio.fec.ccsds.UncorrectableException; | ||
|
||
public class UspBeaconTest { | ||
|
||
@Test | ||
public void testEofException() throws Exception { | ||
public void testFullUSPFrame() throws Exception { | ||
byte[] data = { 8, -1, 27, 0, -92, 100, -126, -100, -116, 64, 96, -92, -90, 96, 96, -90, 64, 111, 0, -16, -31, -1, 2, 0, 1, 0, 3, 0, 0, 38, 6, 61, 86, -113, 23, -116, 104, 84, -30, 119, -60, -1, -65, 0, 0, 0, 0, 0 }; | ||
TestUspBeacon beacon = new TestUspBeacon(); | ||
UspBeacon beacon = new UspBeacon(); | ||
beacon.readBeacon(data); | ||
AssertJson.assertObjectsEqual("UspBeaconEof.json", beacon); | ||
} | ||
|
||
private static class TestUspBeacon extends UspBeacon { | ||
|
||
@Override | ||
public void readBeacon(int etherType, DataInputStream dis) throws IOException, UncorrectableException { | ||
throw new EOFException(); | ||
} | ||
|
||
@Test | ||
public void testShortAx25Frame() throws Exception { | ||
byte[] data = { -92, 100, -126, -100, -116, 64, 96, -92, -90, 96, 96, -90, 64, 111, 0, -16, -31, -1, 2, 0, 1, 0, 3, 0, 0, 38, 6 }; | ||
UspBeacon beacon = new UspBeacon(); | ||
beacon.readBeacon(data); | ||
AssertJson.assertObjectsEqual("UspBeaconEof.json", beacon); | ||
} | ||
|
||
} |
Oops, something went wrong.