12345678910111213141516171819202122232425262728293031323334 |
- // +build linux windows,386
- // Copyright 2013-2014 Fuzamei tech Ltd. All rights reserved.
- package tick
- /*
- #cgo LDFLAGS: -L./lib
- */
- import (
- "log"
- //"market"
- "testing"
- )
- func TestCtp(t *testing.T) {
- conf := &DsConf{
- BrokerId: "66666",
- User: "1011000",
- PassWord: "317496",
- Url: "tcp://ctp1-front5.citicsf.com:41205",
- Url2: "tcp://ctp1-md5.citicsf.com:41213",
- Symbols: "AG1512,IF1509",
- }
- ds := NewDataSource("ctp", conf)
- if ds == nil {
- t.Fatal("NewDataSource ctp error")
- }
- go ds.Run()
- chmk := ds.GetMarket()
- for mk := range chmk {
- log.Println(getTime(mk.Timestamp), mk.InsId)
- }
- log.Println("@@@@@@@:go here")
- }
|