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