1
0
Fork 0
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:
Robin Appelman 2017-08-16 22:02:50 +02:00
commit f360011ef4
3 changed files with 47 additions and 6 deletions

View 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);
});
});