(t *testing.T)
| 83 | } |
| 84 | |
| 85 | func 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 | |
| 105 | func TestMempoolConfigValidateBasic(t *testing.T) { |
| 106 | cfg := TestMempoolConfig() |
nothing calls this directly
no test coverage detected
searching dependent graphs…