-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathtable_type_test.go
78 lines (73 loc) · 1.52 KB
/
table_type_test.go
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
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
// Copyright 2016-2021 the u-root Authors. All rights reserved
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
package smbios
import "testing"
func TestTableTypeString(t *testing.T) {
tests := []struct {
tableType TableType
want string
}{
{
tableType: TableTypeBIOSInfo,
want: "BIOS Information",
},
{
tableType: TableTypeSystemInfo,
want: "System Information",
},
{
tableType: TableTypeBaseboardInfo,
want: "Base Board Information",
},
{
tableType: TableTypeChassisInfo,
want: "Chassis Information",
},
{
tableType: TableTypeProcessorInfo,
want: "Processor Information",
},
{
tableType: TableTypeCacheInfo,
want: "Cache Information",
},
{
tableType: TableTypeSystemSlots,
want: "System Slots",
},
{
tableType: TableTypeMemoryDevice,
want: "Memory Device",
},
{
tableType: TableTypeIPMIDeviceInfo,
want: "IPMI Device Information",
},
{
tableType: TableTypeTPMDevice,
want: "TPM Device",
},
{
tableType: TableTypeInactive,
want: "Inactive",
},
{
tableType: TableTypeEndOfTable,
want: "End Of Table",
},
{
tableType: TableType(0x12),
want: "Unsupported",
},
{
tableType: TableType(0x81),
want: "OEM-specific Type",
},
}
for _, tt := range tests {
if tt.tableType.String() != tt.want {
t.Errorf("TableType.String(): '%s', want '%s'", tt.tableType.String(), tt.want)
}
}
}