blob: e1d370550b5d6fc748e2b7af0243c428cfae1c68 [file] [log] [blame]
// Copyright 2020 The Fuchsia Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
success("StrictBitsUint8KnownValue") {
value = StrictBitsUint8Struct{
b: 1,
},
bytes = {
v2 = [
0x01, padding:7,
],
},
}
success("StrictBitsUint8CombinedValue") {
value = StrictBitsUint8Struct{
b: 3,
},
bytes = {
v2 = [
0x03, padding:7,
],
},
}
success("StrictBitsUint16KnownValue") {
value = StrictBitsUint16Struct{
b: 1,
},
bytes = {
v2 = [
0x01, 0x00, padding:6,
],
},
}
success("StrictBitsUint16CombinedValue") {
value = StrictBitsUint16Struct{
b: 3,
},
bytes = {
v2 = [
0x03, 0x00, padding:6,
],
},
}
success("StrictBitsUint32KnownValue") {
value = StrictBitsUint32Struct{
b: 1,
},
bytes = {
v2 = [
0x01, 0x00, 0x00, 0x00, padding:4,
],
},
}
success("StrictBitsUint32CombinedValue") {
value = StrictBitsUint32Struct{
b: 3,
},
bytes = {
v2 = [
0x03, 0x00, 0x00, 0x00, padding:4,
],
},
}
success("StrictBitsUint64KnownValue") {
value = StrictBitsUint64Struct{
b: 1,
},
bytes = {
v2 = [
0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
],
},
}
success("StrictBitsUint64CombinedValue") {
value = StrictBitsUint64Struct{
b: 3,
},
bytes = {
v2 = [
0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
],
},
}
encode_failure("StrictBitsUint8UnknownBit") {
value = StrictBitsUint8Struct{
b: 4,
},
err = STRICT_BITS_UNKNOWN_BIT,
}
encode_failure("StrictBitsUint16UnknownBit") {
value = StrictBitsUint16Struct{
b: 4,
},
err = STRICT_BITS_UNKNOWN_BIT,
}
encode_failure("StrictBitsUint32UnknownBit") {
value = StrictBitsUint32Struct{
b: 4,
},
err = STRICT_BITS_UNKNOWN_BIT,
}
encode_failure("StrictBitsUint64UnknownBit") {
value = StrictBitsUint64Struct{
b: 4,
},
err = STRICT_BITS_UNKNOWN_BIT,
}
decode_failure("StrictBitsUint8UnknownBit") {
type = StrictBitsUint8Struct,
bytes = {
v2 = [
0x04, padding:7,
],
},
err = STRICT_BITS_UNKNOWN_BIT,
}
decode_failure("StrictBitsUint16UnknownBit") {
type = StrictBitsUint16Struct,
bytes = {
v2 = [
0x04, 0x00, padding:6,
],
},
err = STRICT_BITS_UNKNOWN_BIT,
}
decode_failure("StrictBitsUint32UnknownBit") {
type = StrictBitsUint32Struct,
bytes = {
v2 = [
0x04, 0x00, 0x00, 0x00, padding:4,
],
},
err = STRICT_BITS_UNKNOWN_BIT,
}
decode_failure("StrictBitsUint64UnknownBit") {
type = StrictBitsUint64Struct,
bytes = {
v2 = [
0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
],
},
err = STRICT_BITS_UNKNOWN_BIT,
}