/ util / intelp2m / fields / cb / cb_test.go
cb_test.go
 1  package cb_test
 2  
 3  import (
 4  	"testing"
 5  
 6  	"review.coreboot.org/coreboot.git/util/intelp2m/fields/cb"
 7  	"review.coreboot.org/coreboot.git/util/intelp2m/fields/test"
 8  )
 9  
10  // sliding-one
11  
12  func TestCbFields(t *testing.T) {
13  	referenceSlice := []string{
14  		"_PAD_CFG_STRUCT(, PAD_FUNC(GPIO) | PAD_RESET(PLTRST), 0),",
15  		"_PAD_CFG_STRUCT(, PAD_FUNC(GPIO) | PAD_RESET(DEEP), 0),",
16  		"_PAD_CFG_STRUCT(, PAD_FUNC(GPIO) | (1 << 29), 0),",
17  		"_PAD_CFG_STRUCT(, PAD_FUNC(GPIO) | (1 << 28), 0),",
18  		"_PAD_CFG_STRUCT(, PAD_FUNC(GPIO), 0),",
19  		"_PAD_CFG_STRUCT(, PAD_FUNC(GPIO) | PAD_TRIG(OFF), 0),",
20  		"_PAD_CFG_STRUCT(, PAD_FUNC(GPIO) | PAD_TRIG(EDGE_SINGLE), PAD_CFG1_TOL_1V8),",
21  		"_PAD_CFG_STRUCT(, PAD_FUNC(GPIO), 0),",
22  		"_PAD_CFG_STRUCT(, PAD_FUNC(GPIO) | PAD_RX_POL(INVERT), 0),",
23  		"_PAD_CFG_STRUCT(, PAD_FUNC(GPIO), 0),",
24  		"_PAD_CFG_STRUCT(, PAD_FUNC(GPIO), 0),",
25  		"_PAD_CFG_STRUCT(, PAD_FUNC(GPIO) | PAD_IRQ_ROUTE(IOAPIC), 0),",
26  		"_PAD_CFG_STRUCT(, PAD_FUNC(GPIO) | PAD_IRQ_ROUTE(SCI), 0),",
27  		"_PAD_CFG_STRUCT(, PAD_FUNC(GPIO) | PAD_IRQ_ROUTE(SMI), 0),",
28  		"_PAD_CFG_STRUCT(, PAD_FUNC(GPIO) | PAD_IRQ_ROUTE(NMI), PAD_IOSSTATE(HIZCRx1)),",
29  		"_PAD_CFG_STRUCT(, PAD_FUNC(GPIO), PAD_IOSSTATE(Tx1RxDCRx1)),",
30  		"_PAD_CFG_STRUCT(, PAD_FUNC(GPIO), PAD_IOSSTATE(Tx0RxDCRx1)),",
31  		"_PAD_CFG_STRUCT(, PAD_FUNC(GPIO), PAD_IOSSTATE(Tx0RxDCRx0)),",
32  		"_PAD_CFG_STRUCT(, PAD_FUNC(GPIO), PAD_PULL(INVALID)),", // Error   invalid TERM value =  8
33  		"_PAD_CFG_STRUCT(, PAD_FUNC(NF4), PAD_PULL(DN_20K)),",
34  		"_PAD_CFG_STRUCT(, PAD_FUNC(NF2), PAD_PULL(DN_5K)),",
35  		"_PAD_CFG_STRUCT(, PAD_FUNC(NF1), PAD_PULL(INVALID)),", // Error   invalid TERM value =  1
36  		"_PAD_CFG_STRUCT(, PAD_FUNC(GPIO) | PAD_BUF(RX_DISABLE), PAD_IOSTERM(ENPD)),",
37  		"_PAD_CFG_STRUCT(, PAD_FUNC(GPIO) | PAD_BUF(TX_DISABLE), PAD_IOSTERM(DISPUPD)),",
38  		"_PAD_CFG_STRUCT(, PAD_FUNC(GPIO), 0),",
39  		"_PAD_CFG_STRUCT(, PAD_FUNC(GPIO), 0),",
40  		"_PAD_CFG_STRUCT(, PAD_FUNC(GPIO), 0),",
41  		"_PAD_CFG_STRUCT(, PAD_FUNC(GPIO), 0),",
42  		"_PAD_CFG_STRUCT(, PAD_FUNC(GPIO), 0),",
43  		"_PAD_CFG_STRUCT(, PAD_FUNC(GPIO), 0),",
44  		"_PAD_CFG_STRUCT(, PAD_FUNC(GPIO) | (1 << 1), 0),",
45  		"_PAD_CFG_STRUCT(, PAD_FUNC(GPIO) | 1, 0),",
46  	}
47  	test.SlidingOneTestSuiteCreate(referenceSlice).Run(t, "SLIDING-ONE-TEST", cb.FieldMacros{})
48  }