1goog.module('protobuf.binary.packedFloatTestPairs'); 2 3const BufferDecoder = goog.require('protobuf.binary.BufferDecoder'); 4const {createBufferDecoder} = goog.require('protobuf.binary.bufferDecoderHelper'); 5 6/** 7 * An array of Pairs of packed float values and their bit representation. 8 * This is used to test encoding and decoding from/to the protobuf wire format. 9 * @return {!Array<{name: string, floatValues: !Array<number>, 10 * bufferDecoder: !BufferDecoder, skip_writer: ?boolean}>} 11 */ 12function getPackedFloatPairs() { 13 return [ 14 { 15 name: 'empty value', 16 floatValues: [], 17 bufferDecoder: createBufferDecoder(0x00), 18 skip_writer: true, 19 }, 20 { 21 name: 'single value', 22 floatValues: [1], 23 bufferDecoder: createBufferDecoder(0x04, 0x00, 0x00, 0x80, 0x3F), 24 }, 25 { 26 name: 'multiple values', 27 floatValues: [1, 0], 28 bufferDecoder: createBufferDecoder( 29 0x08, 0x00, 0x00, 0x80, 0x3F, 0x00, 0x00, 0x00, 0x00), 30 }, 31 ]; 32} 33 34exports = {getPackedFloatPairs}; 35