github.com/aergoio/aergo@v1.3.1/cmd/polaris/polaris_test.go (about)

     1  package main
     2  
     3  import (
     4  	"github.com/aergoio/aergo/polaris/common"
     5  	_ "net/http/pprof"
     6  	"testing"
     7  
     8  	"github.com/aergoio/aergo/config"
     9  )
    10  
    11  func Test_arrangeDefaultCfgForPolaris(t *testing.T) {
    12  	tests := []struct {
    13  		name string
    14  	}{
    15  		{"TNormal"},
    16  	}
    17  	for _, tt := range tests {
    18  		t.Run(tt.name, func(t *testing.T) {
    19  			cfg = config.NewServerContext("/","/").GetDefaultConfig().(*config.Config)
    20  			if cfg.RPC.NetServicePort != 7845 {
    21  				t.Errorf("Assumption failure: default cfg.RPC.NetServicePort = %d, want %d",cfg.RPC.NetServicePort, 7845)
    22  			}
    23  			if cfg.P2P.NetProtocolPort != 7846 {
    24  				t.Errorf("Assumption failure: default cfg.P2P.NetProtocolPort = %d, want %d",cfg.P2P.NetProtocolPort, 7846)
    25  			}
    26  			arrangeDefaultCfgForPolaris(cfg)
    27  			if cfg.RPC.NetServicePort != common.DefaultRPCPort {
    28  				t.Errorf("cfg.RPC.NetServicePort = %d, want %d",cfg.RPC.NetServicePort, common.DefaultRPCPort)
    29  			}
    30  			if cfg.P2P.NetProtocolPort != common.DefaultSrvPort {
    31  				t.Errorf("cfg.P2P.NetProtocolPort = %d, want %d",cfg.P2P.NetProtocolPort, common.DefaultSrvPort)
    32  			}
    33  		})
    34  	}
    35  }