| // Copyright 2015 The Vanadium Authors. All rights reserved. |
| // Use of this source code is governed by a BSD-style |
| // license that can be found in the LICENSE file. |
| |
| // This file was auto-generated by the vanadium vdl tool. |
| // Source: encoding.vdl |
| |
| package testdata |
| |
| import ( |
| // VDL system imports |
| "v.io/v23/vdl" |
| |
| // VDL user imports |
| "v.io/x/ref/lib/discovery" |
| ) |
| |
| // PackAddressTest represents a test case for PackAddress. |
| type PackAddressTest struct { |
| // In is the addresses to pack. |
| In []string |
| // Packed is the expected packed output. |
| Packed []byte |
| } |
| |
| func (PackAddressTest) __VDLReflect(struct { |
| Name string `vdl:"v.io/x/ref/lib/discovery/testdata.PackAddressTest"` |
| }) { |
| } |
| |
| // PackEncryptionKeysTest represents a test case for PackEncryptionKeys |
| type PackEncryptionKeysTest struct { |
| // Algo is the algorithm that's in use. |
| // but that isn't defined in vdl yet. |
| Algo discovery.EncryptionAlgorithm |
| // Keys are the encryption keys. |
| // but that isn't defined in vdl yet. |
| Keys []discovery.EncryptionKey |
| // Packed is the expected output bytes. |
| Packed []byte |
| } |
| |
| func (PackEncryptionKeysTest) __VDLReflect(struct { |
| Name string `vdl:"v.io/x/ref/lib/discovery/testdata.PackEncryptionKeysTest"` |
| }) { |
| } |
| |
| func init() { |
| vdl.Register((*PackAddressTest)(nil)) |
| vdl.Register((*PackEncryptionKeysTest)(nil)) |
| } |
| |
| var PackAddressTestData = []PackAddressTest{ |
| { |
| In: []string{ |
| "a12345", |
| }, |
| Packed: []byte("\x06a12345"), |
| }, |
| { |
| In: []string{ |
| "a1234", |
| "b5678", |
| "c9012", |
| }, |
| Packed: []byte("\x05a1234\x05b5678\x05c9012"), |
| }, |
| {}, |
| } |
| |
| var PackEncryptionKeysTestData = []PackEncryptionKeysTest{ |
| { |
| Algo: 1, |
| Keys: []discovery.EncryptionKey{ |
| discovery.EncryptionKey("0123456789"), |
| }, |
| Packed: []byte("\x01\n0123456789"), |
| }, |
| { |
| Algo: 2, |
| Keys: []discovery.EncryptionKey{ |
| discovery.EncryptionKey("012345"), |
| discovery.EncryptionKey("123456"), |
| discovery.EncryptionKey("234567"), |
| }, |
| Packed: []byte("\x02\x06012345\x06123456\x06234567"), |
| }, |
| { |
| Packed: []byte("\x00"), |
| }, |
| } |