fix db test compile issue

This commit is contained in:
saji 2023-07-03 13:56:42 -05:00
parent c68dff9d40
commit fcfc605f77
2 changed files with 13 additions and 1 deletions

1
.gitignore vendored
View file

@ -27,3 +27,4 @@ go.work
/skylabify /skylabify
*.db *.db
*.db-journal *.db-journal
/logs/

View file

@ -3,6 +3,7 @@ package db
import ( import (
"reflect" "reflect"
"testing" "testing"
"time"
"github.com/jmoiron/sqlx" "github.com/jmoiron/sqlx"
"github.com/kschamplin/gotelem/skylab" "github.com/kschamplin/gotelem/skylab"
@ -10,7 +11,17 @@ import (
// helper func to get a random bus event with random data. // helper func to get a random bus event with random data.
func GetRandomBusEvent() skylab.BusEvent { func GetRandomBusEvent() skylab.BusEvent {
return data := skylab.WsrVelocity{
MotorVelocity: 1.0,
VehicleVelocity: 4.0,
}
ev := skylab.BusEvent{
Timestamp: time.Now(),
Data: &data,
}
ev.Id, _ = data.CANId()
return ev
} }
func TestTelemDb(t *testing.T) { func TestTelemDb(t *testing.T) {