MCPcopy Create free account
hub / github.com/tendermint/tendermint / TestP2PConfigValidateBasic

Function TestP2PConfigValidateBasic

config/config_test.go:85–103  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

83}
84
85func TestP2PConfigValidateBasic(t *testing.T) {
86 cfg := TestP2PConfig()
87 assert.NoError(t, cfg.ValidateBasic())
88
89 fieldsToTest := []string{
90 "MaxNumInboundPeers",
91 "MaxNumOutboundPeers",
92 "FlushThrottleTimeout",
93 "MaxPacketMsgPayloadSize",
94 "SendRate",
95 "RecvRate",
96 }
97
98 for _, fieldName := range fieldsToTest {
99 reflect.ValueOf(cfg).Elem().FieldByName(fieldName).SetInt(-1)
100 assert.Error(t, cfg.ValidateBasic())
101 reflect.ValueOf(cfg).Elem().FieldByName(fieldName).SetInt(0)
102 }
103}
104
105func TestMempoolConfigValidateBasic(t *testing.T) {
106 cfg := TestMempoolConfig()

Callers

nothing calls this directly

Calls 3

TestP2PConfigFunction · 0.85
ValidateBasicMethod · 0.65
ErrorMethod · 0.65

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…