1/** 2 * @fileoverview Test data for float encoding and decoding. 3 */ 4goog.module('protobuf.binary.fixed32TestPairs'); 5 6const BufferDecoder = goog.require('protobuf.binary.BufferDecoder'); 7const {createBufferDecoder} = goog.require('protobuf.binary.bufferDecoderHelper'); 8 9/** 10 * An array of Pairs of float values and their bit representation. 11 * This is used to test encoding and decoding from/to the protobuf wire format. 12 * @return {!Array<{name: string, intValue: number, bufferDecoder: 13 * !BufferDecoder}>} 14 */ 15function getFixed32Pairs() { 16 const fixed32Pairs = [ 17 { 18 name: 'zero', 19 intValue: 0, 20 bufferDecoder: createBufferDecoder(0x00, 0x00, 0x00, 0x00), 21 }, 22 { 23 name: 'one ', 24 intValue: 1, 25 bufferDecoder: createBufferDecoder(0x01, 0x00, 0x00, 0x00) 26 }, 27 { 28 name: 'max int 2^32 -1', 29 intValue: Math.pow(2, 32) - 1, 30 bufferDecoder: createBufferDecoder(0xFF, 0xFF, 0xFF, 0xFF) 31 }, 32 ]; 33 return [...fixed32Pairs]; 34} 35 36exports = {getFixed32Pairs}; 37