Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gosqlite
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
gosqlite
Commits
746114df
Commit
746114df
authored
Feb 21, 2016
by
gwenn
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Skip some tests when cgocheck is enabled.
parent
40f42098
Changes
10
Show whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
45 additions
and
8 deletions
+45
-8
.travis.yml
.travis.yml
+1
-0
busy_test.go
busy_test.go
+4
-0
cache_test.go
cache_test.go
+1
-1
csv_test.go
csv_test.go
+4
-0
function_test.go
function_test.go
+8
-0
hook_test.go
hook_test.go
+7
-0
sqlite_test.go
sqlite_test.go
+7
-0
stmt.go
stmt.go
+4
-4
trace_test.go
trace_test.go
+7
-3
vtab_test.go
vtab_test.go
+2
-0
No files found.
.travis.yml
View file @
746114df
...
...
@@ -15,4 +15,5 @@ install:
before_script
:
-
go get github.com/bmizerany/assert
script
:
-
GODEBUG=cgocheck=2 go test -v -tags all github.com/gwenn/gosqlite
-
GODEBUG=cgocheck=0 go test -v -tags all github.com/gwenn/gosqlite
busy_test.go
View file @
746114df
...
...
@@ -15,6 +15,8 @@ import (
)
func
TestInterrupt
(
t
*
testing
.
T
)
{
skipIfCgoCheckActive
(
t
)
db
:=
open
(
t
)
defer
checkClose
(
db
,
t
)
db
.
CreateScalarFunction
(
"interrupt"
,
0
,
false
,
nil
,
func
(
ctx
*
ScalarContext
,
nArg
int
)
{
...
...
@@ -85,6 +87,8 @@ func TestBusyTimeout(t *testing.T) {
}
func
TestBusyHandler
(
t
*
testing
.
T
)
{
skipIfCgoCheckActive
(
t
)
f
,
db1
,
db2
:=
openTwoConnSameDb
(
t
)
defer
os
.
Remove
(
f
.
Name
())
defer
checkClose
(
db1
,
t
)
...
...
cache_test.go
View file @
746114df
...
...
@@ -5,8 +5,8 @@
package
sqlite_test
import
(
"testing"
.
"github.com/gwenn/gosqlite"
"testing"
)
func
checkCacheSize
(
t
*
testing
.
T
,
db
*
Conn
,
expectedSize
,
expectedMaxSize
int
)
{
...
...
csv_test.go
View file @
746114df
...
...
@@ -17,6 +17,8 @@ import (
)
func
TestCsvModule
(
t
*
testing
.
T
)
{
skipIfCgoCheckActive
(
t
)
db
:=
open
(
t
)
defer
checkClose
(
db
,
t
)
err
:=
LoadCsvModule
(
db
)
...
...
@@ -112,6 +114,8 @@ var csvModuleTests = []struct {
}
func
TestCsvModuleArguments
(
t
*
testing
.
T
)
{
skipIfCgoCheckActive
(
t
)
db
:=
open
(
t
)
defer
checkClose
(
db
,
t
)
err
:=
LoadCsvModule
(
db
)
...
...
function_test.go
View file @
746114df
...
...
@@ -24,6 +24,8 @@ func half(ctx *ScalarContext, nArg int) {
}
func
TestScalarFunction
(
t
*
testing
.
T
)
{
skipIfCgoCheckActive
(
t
)
db
:=
open
(
t
)
defer
checkClose
(
db
,
t
)
err
:=
db
.
CreateScalarFunction
(
"half"
,
1
,
true
,
nil
,
half
,
nil
)
...
...
@@ -71,6 +73,8 @@ func reDestroy(ad interface{}) {
}
func
TestRegexpFunction
(
t
*
testing
.
T
)
{
skipIfCgoCheckActive
(
t
)
db
:=
open
(
t
)
defer
checkClose
(
db
,
t
)
err
:=
db
.
CreateScalarFunction
(
"regexp"
,
2
,
true
,
nil
,
re
,
reDestroy
)
...
...
@@ -106,6 +110,8 @@ func user(ctx *ScalarContext, nArg int) {
}
func
TestUserFunction
(
t
*
testing
.
T
)
{
skipIfCgoCheckActive
(
t
)
db
:=
open
(
t
)
defer
checkClose
(
db
,
t
)
err
:=
db
.
CreateScalarFunction
(
"user"
,
0
,
false
,
nil
,
user
,
nil
)
...
...
@@ -140,6 +146,8 @@ func sumFinal(ctx *AggregateContext) {
}
func
TestSumFunction
(
t
*
testing
.
T
)
{
skipIfCgoCheckActive
(
t
)
db
:=
open
(
t
)
defer
checkClose
(
db
,
t
)
err
:=
db
.
CreateAggregateFunction
(
"mysum"
,
1
,
nil
,
sumStep
,
sumFinal
,
nil
)
...
...
hook_test.go
View file @
746114df
...
...
@@ -7,6 +7,7 @@ package sqlite_test
import
(
"fmt"
"testing"
.
"github.com/gwenn/gosqlite"
)
...
...
@@ -44,6 +45,8 @@ func TestNoHook(t *testing.T) {
}
func
TestCommitHook
(
t
*
testing
.
T
)
{
skipIfCgoCheckActive
(
t
)
db
:=
open
(
t
)
defer
checkClose
(
db
,
t
)
...
...
@@ -54,6 +57,8 @@ func TestCommitHook(t *testing.T) {
}
func
TestRollbackHook
(
t
*
testing
.
T
)
{
skipIfCgoCheckActive
(
t
)
db
:=
open
(
t
)
defer
checkClose
(
db
,
t
)
...
...
@@ -64,6 +69,8 @@ func TestRollbackHook(t *testing.T) {
}
func
TestUpdateHook
(
t
*
testing
.
T
)
{
skipIfCgoCheckActive
(
t
)
db
:=
open
(
t
)
defer
checkClose
(
db
,
t
)
createTable
(
db
,
t
)
...
...
sqlite_test.go
View file @
746114df
...
...
@@ -6,6 +6,7 @@ package sqlite_test
import
(
"fmt"
"os"
"path"
"reflect"
"runtime"
...
...
@@ -23,6 +24,12 @@ func checkNoError(t *testing.T, err error, format string) {
}
}
func
skipIfCgoCheckActive
(
t
*
testing
.
T
)
{
if
runtime
.
Version
()
>=
"go1.6"
&&
!
strings
.
Contains
(
os
.
Getenv
(
"GODEBUG"
),
"cgocheck=0"
)
{
t
.
Skip
(
"cgocheck"
)
}
}
func
Must
(
b
bool
,
err
error
)
bool
{
if
err
!=
nil
{
panic
(
err
)
...
...
stmt.go
View file @
746114df
...
...
@@ -382,11 +382,11 @@ func (s *Stmt) BindByIndex(index int, value interface{}) error {
if
i64
&&
len
(
value
)
>
math
.
MaxInt32
{
return
s
.
specificError
(
"blob too big: %d at index %d"
,
len
(
value
),
index
)
}
var
p
*
byte
if
len
(
value
)
>
0
{
p
=
&
value
[
0
]
if
len
(
value
)
==
0
{
rv
=
C
.
my_bind_blob
(
s
.
stmt
,
i
,
nil
,
0
)
}
else
{
rv
=
C
.
my_bind_blob
(
s
.
stmt
,
i
,
unsafe
.
Pointer
(
&
value
[
0
]),
C
.
int
(
len
(
value
)))
}
rv
=
C
.
my_bind_blob
(
s
.
stmt
,
i
,
unsafe
.
Pointer
(
p
),
C
.
int
(
len
(
value
)))
case
time
.
Time
:
if
NullIfZeroTime
&&
value
.
IsZero
()
{
rv
=
C
.
sqlite3_bind_null
(
s
.
stmt
,
i
)
...
...
trace_test.go
View file @
746114df
...
...
@@ -17,12 +17,12 @@ import (
func
init
()
{
if
os
.
Getenv
(
"SQLITE_LOG"
)
==
""
{
err
:=
ConfigLog
(
func
(
d
interface
{},
err
error
,
msg
string
)
{
fmt
.
Printf
(
"
%s: %s, %s
\n
"
,
d
,
err
,
msg
)
},
"SQLITE"
)
fmt
.
Printf
(
"
SQLITE: %s, %s
\n
"
,
err
,
msg
)
},
nil
)
if
err
!=
nil
{
panic
(
fmt
.
Sprintf
(
"couldn't config log: '%s'"
,
err
))
}
err
=
ConfigLog
(
nil
,
""
)
err
=
ConfigLog
(
nil
,
nil
)
if
err
!=
nil
{
panic
(
fmt
.
Sprintf
(
"couldn't unset logger: '%s'"
,
err
))
}
...
...
@@ -74,6 +74,8 @@ func TestNoTrace(t *testing.T) {
}
func
TestTrace
(
t
*
testing
.
T
)
{
skipIfCgoCheckActive
(
t
)
db
:=
open
(
t
)
defer
checkClose
(
db
,
t
)
db
.
Trace
(
trace
,
t
)
...
...
@@ -88,6 +90,8 @@ func TestTrace(t *testing.T) {
}
func
TestProfile
(
t
*
testing
.
T
)
{
skipIfCgoCheckActive
(
t
)
db
:=
open
(
t
)
defer
checkClose
(
db
,
t
)
db
.
Profile
(
profile
,
t
)
...
...
vtab_test.go
View file @
746114df
...
...
@@ -99,6 +99,8 @@ func (vc *testVTabCursor) Rowid() (int64, error) {
}
func
TestCreateModule
(
t
*
testing
.
T
)
{
skipIfCgoCheckActive
(
t
)
db
:=
open
(
t
)
defer
checkClose
(
db
,
t
)
intarray
:=
[]
int
{
1
,
2
,
3
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment