optimizer_test.go 435 字节
Newer Older
H
Helin Wang 已提交
1 2
package pserver

D
dongzhihong 已提交
3 4 5 6
import (
	"io/ioutil"
	"testing"
)
H
Helin Wang 已提交
7

D
dongzhihong 已提交
8 9 10
func TestOptimizerCreateRelease(t *testing.T) {
	p := Parameter{
		Name:        "a",
D
dongzhihong 已提交
11
		ElementType: Int32,
D
dzhwinter 已提交
12
	}
D
dongzhihong 已提交
13
	p.Content = []byte{1, 3}
Q
Qiao Longfei 已提交
14
	config, err := ioutil.ReadFile("./client/c/test/testdata/optimizer.pb")
D
dongzhihong 已提交
15 16 17
	if err != nil {
		t.Fatalf("read optimizer proto failed")
	}
D
dongzhihong 已提交
18 19 20 21
	param := ParameterWithConfig{
		Param:  p,
		Config: config,
	}
D
dongzhihong 已提交
22
	o := newOptimizer(param, nil)
H
Helin Wang 已提交
23 24
	o.Cleanup()
}