-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathdecoder_default_field_shape_test.go
More file actions
38 lines (32 loc) · 1.21 KB
/
Copy pathdecoder_default_field_shape_test.go
File metadata and controls
38 lines (32 loc) · 1.21 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
//go:build !gopus_dred && !gopus_osce
package gopus
import (
"testing"
"unsafe"
)
// These tests assert the DRED/OSCE decoder embeds carry no storage in the
// default build, keeping the Decoder struct byte-unchanged when neither
// gopus_dred nor gopus_osce is set (the zero-cost gated-feature
// contract).
func TestDefaultBuildDecoderDREDFieldsAreZeroSize(t *testing.T) {
if got := unsafe.Sizeof(decoderDREDFields{}); got != 0 {
t.Fatalf("decoderDREDFields size=%d want 0", got)
}
}
func TestDefaultBuildDecoderOSCEFieldsAreZeroSize(t *testing.T) {
if got := unsafe.Sizeof(decoderOSCEFields{}); got != 0 {
t.Fatalf("decoderOSCEFields size = %d, want 0", got)
}
if got := unsafe.Sizeof(decoderOSCEBWEState{}); got != 0 {
t.Fatalf("decoderOSCEBWEState size = %d, want 0", got)
}
if got := unsafe.Sizeof(decoderOSCELACEState{}); got != 0 {
t.Fatalf("decoderOSCELACEState size = %d, want 0", got)
}
}
// assertDecoderDREDRuntimeLoadedForTest is the default-build twin of the
// gopus_dred helper: with DRED compiled out there is no neural runtime to
// assert, so it is a no-op that lets shared tests stay tag-agnostic.
func assertDecoderDREDRuntimeLoadedForTest(t testing.TB, _ *Decoder, _ string) {
t.Helper()
}