lib func test added.

This commit is contained in:
nobonobo 2013-11-27 09:03:38 +09:00
parent 4c6b4dbf1f
commit 3fb505671b
2 changed files with 23 additions and 2 deletions

View file

@ -8,7 +8,6 @@ package unqlitego
import "C" import "C"
import ( import (
"errors"
"fmt" "fmt"
"runtime" "runtime"
"unsafe" "unsafe"
@ -299,8 +298,8 @@ func Shutdown() (err error) {
res := C.unqlite_lib_shutdown() res := C.unqlite_lib_shutdown()
if res != C.UNQLITE_OK { if res != C.UNQLITE_OK {
err = UnQLiteError(res) err = UnQLiteError(res)
return
} }
return
} }
// IsThreadSafe ... // IsThreadSafe ...

View file

@ -8,6 +8,28 @@ import (
"testing" "testing"
) )
func Testライブラリ(t *testing.T) {
Describe(t, "正常系", func() {
Context("基本テスト", func() {
It("IsThreadSafe", func() {
Expect(IsThreadSafe()).To(Equal, true)
})
It("Version", func() {
Expect(Version()).To(Equal, "1.1.6")
})
It("Signature", func() {
Expect(Signature()).To(Equal, "unqlite/1.1.6")
})
It("Ident", func() {
Expect(Ident()).To(Equal, "unqlite:b172a1e2c3f62fb35c8e1fb2795121f82356cad6")
})
It("Copyright", func() {
Expect(Copyright()).To(Equal, "Copyright (C) Symisc Systems, S.U.A.R.L [Mrad Chems Eddine <chm@symisc.net>] 2012-2013, http://unqlite.org/")
})
})
})
}
func Testモジュール(t *testing.T) { func Testモジュール(t *testing.T) {
var db *Database var db *Database
var src []byte var src []byte