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