• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1goog.module('protobuf.binary.packedUint32TestPairs');
2
3const BufferDecoder = goog.require('protobuf.binary.BufferDecoder');
4const {createBufferDecoder} = goog.require('protobuf.binary.bufferDecoderHelper');
5
6/**
7 * An array of Pairs of packed uint32 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, uint32Values: !Array<number>,
10 *                  bufferDecoder: !BufferDecoder, skip_writer: ?boolean}>}
11 */
12function getPackedUint32Pairs() {
13  return [
14    {
15      name: 'empty value',
16      uint32Values: [],
17      bufferDecoder: createBufferDecoder(0x00),
18      skip_writer: true,
19    },
20    {
21      name: 'single value',
22      uint32Values: [1],
23      bufferDecoder: createBufferDecoder(0x01, 0x01),
24    },
25    {
26      name: 'multiple values',
27      uint32Values: [1, 0],
28      bufferDecoder: createBufferDecoder(0x02, 0x01, 0x00),
29    },
30  ];
31}
32
33exports = {getPackedUint32Pairs};
34