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