-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathnative_protocol_services_test.go
More file actions
29 lines (26 loc) · 985 Bytes
/
Copy pathnative_protocol_services_test.go
File metadata and controls
29 lines (26 loc) · 985 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
package main
import (
"reflect"
"testing"
)
var (
_ credentialCodec = nativeCredentialCodec{}
_ runtimeFieldGenerator = (*nativeRuntimeFieldGenerator)(nil)
_ modelCacheDecryptor = nativeModelCacheDecryptor{}
_ protocolContextFactory = (*nativeContextFactory)(nil)
_ protocolContext = (*nativeProtocolContext)(nil)
)
func TestNativeProtocolServicesConstructorWiresRealInferPreparer(t *testing.T) {
host := validNativeContextHost()
services, err := newProtocolServices(host)
if err != nil {
t.Fatalf("newProtocolServices() returned error kind %q", protocolErrorKindOf(err))
}
factory, ok := services.contextFactory.(*nativeContextFactory)
if !ok || factory == nil {
t.Fatalf("context factory type = %T, want *nativeContextFactory", services.contextFactory)
}
if reflect.ValueOf(factory.prepare).Pointer() != reflect.ValueOf(prepareNativeInferRequest).Pointer() {
t.Fatal("native context factory is not wired to real inference preparation")
}
}