Skip to content

Commit

Permalink
update mocks
Browse files Browse the repository at this point in the history
  • Loading branch information
DarienRaymond committed Oct 23, 2018
1 parent 4988b5a commit 9e66f31
Show file tree
Hide file tree
Showing 9 changed files with 71 additions and 65 deletions.
2 changes: 1 addition & 1 deletion app/log/command/config.pb.go
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
package command

import (
"context"
fmt "fmt"
proto "github.com/golang/protobuf/proto"
"context"
grpc "google.golang.org/grpc"
math "math"
)
Expand Down
2 changes: 1 addition & 1 deletion app/proxyman/command/command.pb.go
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
package command

import (
"context"
fmt "fmt"
proto "github.com/golang/protobuf/proto"
"context"
grpc "google.golang.org/grpc"
math "math"
core "v2ray.com/core"
Expand Down
4 changes: 2 additions & 2 deletions app/router/router_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ func TestSimpleRouter(t *testing.T) {
mockCtl := gomock.NewController(t)
defer mockCtl.Finish()

mockDns := mocks.NewMockDNSClient(mockCtl)
mockDns := mocks.NewDNSClient(mockCtl)

r := new(Router)
common.Must(r.Init(config, mockDns))
Expand Down Expand Up @@ -58,7 +58,7 @@ func TestIPOnDemand(t *testing.T) {
mockCtl := gomock.NewController(t)
defer mockCtl.Finish()

mockDns := mocks.NewMockDNSClient(mockCtl)
mockDns := mocks.NewDNSClient(mockCtl)
mockDns.EXPECT().LookupIP(gomock.Eq("v2ray.com")).Return([]net.IP{{192, 168, 0, 1}}, nil).AnyTimes()

r := new(Router)
Expand Down
2 changes: 1 addition & 1 deletion app/stats/command/command.pb.go
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
package command

import (
"context"
fmt "fmt"
proto "github.com/golang/protobuf/proto"
"context"
grpc "google.golang.org/grpc"
math "math"
)
Expand Down
7 changes: 5 additions & 2 deletions features/errors.generated.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,8 @@ package features

import "v2ray.com/core/common/errors"

type errPathObjHolder struct {}
func newError(values ...interface{}) *errors.Error { return errors.New(values...).WithPathObj(errPathObjHolder{}) }
type errPathObjHolder struct{}

func newError(values ...interface{}) *errors.Error {
return errors.New(values...).WithPathObj(errPathObjHolder{})
}
7 changes: 5 additions & 2 deletions features/stats/errors.generated.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,8 @@ package stats

import "v2ray.com/core/common/errors"

type errPathObjHolder struct {}
func newError(values ...interface{}) *errors.Error { return errors.New(values...).WithPathObj(errPathObjHolder{}) }
type errPathObjHolder struct{}

func newError(values ...interface{}) *errors.Error {
return errors.New(values...).WithPathObj(errPathObjHolder{})
}
4 changes: 2 additions & 2 deletions mocks.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,5 @@ package core

//go:generate go get -u github.com/golang/mock/gomock
//go:generate go install github.com/golang/mock/mockgen
//go:generate mockgen -package mocks -destination v2ray.com/core/testing/mocks/dns.go -mock_names Client=MockDNSClient v2ray.com/core/features/dns Client
//go:generate mockgen -package mocks -destination v2ray.com/core/testing/mocks/proxy.go -mock_names Inbound=MockProxyInbound,Outbound=MockProxyOutbound v2ray.com/core/proxy Inbound,Outbound
//go:generate mockgen -package mocks -destination testing/mocks/dns.go -mock_names Client=DNSClient v2ray.com/core/features/dns Client
//go:generate mockgen -package mocks -destination testing/mocks/proxy.go -mock_names Inbound=ProxyInbound,Outbound=ProxyOutbound v2ray.com/core/proxy Inbound,Outbound
46 changes: 23 additions & 23 deletions testing/mocks/dns.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

62 changes: 31 additions & 31 deletions testing/mocks/proxy.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 9e66f31

Please sign in to comment.