mirror of
https://github.com/demostf/demo.js
synced 2026-06-04 00:54:14 +02:00
add encoder for voiceData
This commit is contained in:
parent
7f2d702ab0
commit
f360011ef4
3 changed files with 47 additions and 6 deletions
27
src/tests/unit/Parser/Packet/VoiceDataTest.ts
Normal file
27
src/tests/unit/Parser/Packet/VoiceDataTest.ts
Normal file
|
|
@ -0,0 +1,27 @@
|
|||
import {BitStream} from 'bit-buffer';
|
||||
import {assertEncoder, assertParser, getStream} from './PacketTest';
|
||||
import {EncodeVoiceData, ParseVoiceData} from '../../../../Parser/Packet/VoiceData';
|
||||
|
||||
const data = [5, 18, 24, 0, 123, 219, 1];
|
||||
|
||||
suite('VoiceInit', () => {
|
||||
test('Parse voiceInit', () => {
|
||||
assertParser(ParseVoiceData, getStream(data), {
|
||||
packetType: 'voiceData',
|
||||
client: '5',
|
||||
proximity: 18,
|
||||
length: 24,
|
||||
data: getStream([123, 219, 1])
|
||||
}, 56);
|
||||
});
|
||||
|
||||
test('Encode voiceInit', () => {
|
||||
assertEncoder(ParseVoiceData, EncodeVoiceData, {
|
||||
packetType: 'voiceData',
|
||||
client: '5',
|
||||
proximity: 18,
|
||||
length: 24,
|
||||
data: getStream([123, 219, 1])
|
||||
}, 56);
|
||||
});
|
||||
});
|
||||
Loading…
Add table
Add a link
Reference in a new issue