mirror of
https://github.com/v2fly/v2ray-core.git
synced 2024-12-22 01:57:12 -05:00
use correct function for to context
This commit is contained in:
parent
758290314f
commit
03b0c8efd9
@ -22,8 +22,8 @@ func TestInterfaces(t *testing.T) {
|
||||
_ = (outbound.Manager)(new(Manager))
|
||||
}
|
||||
|
||||
//go:linkname mustToContextForced github.com/v2fly/v2ray-core/v4.mustToContext
|
||||
func mustToContextForced(ctx context.Context, v *core.Instance) context.Context
|
||||
//go:linkname toContext github.com/v2fly/v2ray-core/v4.toContext
|
||||
func toContext(ctx context.Context, v *core.Instance) context.Context
|
||||
|
||||
func TestOutboundWithoutStatCounter(t *testing.T) {
|
||||
config := &core.Config{
|
||||
@ -41,7 +41,7 @@ func TestOutboundWithoutStatCounter(t *testing.T) {
|
||||
|
||||
v, _ := core.New(config)
|
||||
v.AddFeature((outbound.Manager)(new(Manager)))
|
||||
ctx := mustToContextForced(context.Background(), v)
|
||||
ctx := toContext(context.Background(), v)
|
||||
h, _ := NewHandler(ctx, &core.OutboundHandlerConfig{
|
||||
Tag: "tag",
|
||||
ProxySettings: serial.ToTypedMessage(&freedom.Config{}),
|
||||
@ -70,7 +70,7 @@ func TestOutboundWithStatCounter(t *testing.T) {
|
||||
|
||||
v, _ := core.New(config)
|
||||
v.AddFeature((outbound.Manager)(new(Manager)))
|
||||
ctx := mustToContextForced(context.Background(), v)
|
||||
ctx := toContext(context.Background(), v)
|
||||
h, _ := NewHandler(ctx, &core.OutboundHandlerConfig{
|
||||
Tag: "tag",
|
||||
ProxySettings: serial.ToTypedMessage(&freedom.Config{}),
|
||||
|
Loading…
Reference in New Issue
Block a user