MCPcopy Create free account
hub / github.com/DeAI-Artist/Linkis / TestP2PConfigValidateBasic

Function TestP2PConfigValidateBasic

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

Source from the content-addressed store, hash-verified

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

Callers

nothing calls this directly

Calls 3

TestP2PConfigFunction · 0.85
ValidateBasicMethod · 0.65
ErrorMethod · 0.65

Tested by

no test coverage detected