Commit b4fde85e authored by gwenn's avatar gwenn

Attempt to fix Travis build.

parent b12b6197
......@@ -8,4 +8,6 @@ before_install:
- sudo apt-get install -qq libsqlite3-dev
before_script:
- go get github.com/bmizerany/assert
- go get github.com/gwenn/gosqlite
- go get -tags all github.com/gwenn/gosqlite
script:
- go test -tags all ./...
\ No newline at end of file
......@@ -206,8 +206,9 @@ func TestTimeStamp(t *testing.T) {
var ts TimeStamp
err = db.OneValue("SELECT time FROM test where ROWID = ?", &ts, id)
checkNoError(t, err, "error selecting TimeStamp: %s")
//fmt.Printf("%v (%d) <=> %v (%d)\n", now, now.Unix(), time.Time(ts), time.Time(ts).Unix())
assert.Tf(t, now == time.Time(ts), "got %s; want %s", now, time.Time(ts))
if !now.Equal(time.Time(ts)) {
t.Errorf("got timeStamp: %s; want %s", time.Time(ts), now)
}
err = db.OneValue("SELECT null", &ts)
checkNoError(t, err, "%s")
......
......@@ -249,9 +249,9 @@ func TestScanNumericalAsTime(t *testing.T) {
var ms time.Time
err = row.Scan(&ms)
checkNoError(t, err, "%s")
//fmt.Printf("%v (%d) <=> %v (%d)\n", now, now.Unix(), ms, ms.Unix())
//assert.Equal(t, now, ms)
assert.Tf(t, now == ms, "got %s; want %s", now, ms)
if !now.Equal(ms) {
t.Errorf("got timeStamp: %s; want %s", ms, now)
}
_, err = db.Exec("DELETE FROM test; INSERT INTO test VALUES (?)", "bim")
checkNoError(t, err, "%s")
......
......@@ -82,6 +82,10 @@ func TestSetLockingMode(t *testing.T) {
mode, err := db.SetLockingMode("", "exclusive")
checkNoError(t, err, "Error setting locking-mode of database: %s")
assert.Equal(t, "exclusive", mode)
_, err = db.SetLockingMode("bim", "exclusive")
assert.T(t, err != nil)
//println(err.Error())
}
func TestSynchronous(t *testing.T) {
......
......@@ -189,7 +189,7 @@ func TestInsert(t *testing.T) {
}
/*
func TestLoadExtension(t *testing.T) {
func TestLoadExtension(t *testing.T) { // OMIT_LOAD_EXTENSION
db := open(t)
db.EnableLoadExtension(true)
......
......@@ -382,6 +382,10 @@ func TestStmtSelectWithInsert(t *testing.T) {
t.Errorf("got %s; want StmtError", reflect.TypeOf(err))
}
assert.T(t, !exists, "false expected")
err = s.Select(nil)
assert.T(t, err != nil)
//println(err.Error())
}
func TestNamedBind(t *testing.T) {
......
......@@ -71,7 +71,7 @@ func (vc *testVTabCursor) Close() error {
//fmt.Printf("testVTabCursor.Close: %v\n", vc)
return nil
}
func (vc *testVTabCursor) Filter( /*idxNum int, idxStr string, int argc, sqlite3_value **argv*/) error {
func (vc *testVTabCursor) Filter( /*idxNum int, idxStr string, int argc, sqlite3_value **argv*/ ) error {
//fmt.Printf("testVTabCursor.Filter: %v\n", vc)
vc.index = 0
return nil
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment