Skip to content

Commit

Permalink
add sender and receiver configs test
Browse files Browse the repository at this point in the history
  • Loading branch information
ortex committed Apr 5, 2023
1 parent 597bac7 commit 71afced
Show file tree
Hide file tree
Showing 2 changed files with 41 additions and 0 deletions.
20 changes: 20 additions & 0 deletions src/test/java/org/rocstreaming/roctoolkit/ReceiverTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,26 @@ public void TestValidReceiverCreationAndDeinitialization() {
});
}

@Test
public void TestValidReceiverCreationAndDeinitializationWithFullConfig() {
ReceiverConfig config = new ReceiverConfig.Builder(SAMPLE_RATE, ChannelSet.STEREO, FrameEncoding.PCM_FLOAT)
.clockSource(ClockSource.INTERNAL)
.resamplerBackend(ResamplerBackend.BUILTIN)
.resamplerProfile(ResamplerProfile.HIGH)
.targetLatency(1000)
.maxLatencyOverrun(500)
.maxLatencyUnderrun(500)
.noPlaybackTimeout(2000)
.brokenPlaybackTimeout(2000)
.breakageDetectionWindow(2000)
.build();
assertDoesNotThrow(() -> {
//noinspection EmptyTryBlock
try (Receiver ignored = new Receiver(context, config)) {
}
});
}

@Test
@SuppressWarnings("resource")
public void TestInvalidReceiverCreation() {
Expand Down
21 changes: 21 additions & 0 deletions src/test/java/org/rocstreaming/roctoolkit/SenderTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,27 @@ public void TestValidSenderCreationAndDeinitialization() {
});
}

@Test
public void TestValidSenderCreationAndDeinitializationWithFullConfig() {
SenderConfig config = new SenderConfig.Builder(SAMPLE_RATE, ChannelSet.STEREO, FrameEncoding.PCM_FLOAT)
.packetSampleRate(44100)
.packetChannels(ChannelSet.STEREO)
.packetLength(2000)
.packetInterleaving(1)
.clockSource(ClockSource.INTERNAL)
.resamplerBackend(ResamplerBackend.BUILTIN)
.resamplerProfile(ResamplerProfile.HIGH)
.fecEncoding(FecEncoding.RS8M)
.fecBlockSourcePackets(10)
.fecBlockRepairPackets(10)
.build();
assertDoesNotThrow(() -> {
//noinspection EmptyTryBlock
try (Sender ignored = new Sender(context, config)) {
}
});
}

@Test
@SuppressWarnings("resource")
public void TestInvalidSenderCreation() {
Expand Down

0 comments on commit 71afced

Please sign in to comment.