mirror of
https://github.com/ncruces/go-sqlite3.git
synced 2026-01-12 05:59:14 +00:00
Fix test.
This commit is contained in:
2
conn.go
2
conn.go
@@ -152,7 +152,7 @@ func (c *Conn) new(len uint32) uint32 {
|
||||
panic(err)
|
||||
}
|
||||
ptr := uint32(r[0])
|
||||
if ptr == 0 {
|
||||
if ptr == 0 && len != 0 {
|
||||
panic(oomErr)
|
||||
}
|
||||
return ptr
|
||||
|
||||
@@ -114,7 +114,7 @@ func TestConn_free(t *testing.T) {
|
||||
|
||||
db.free(0)
|
||||
|
||||
ptr := db.new(0)
|
||||
ptr := db.new(1)
|
||||
if ptr == 0 {
|
||||
t.Error("got nullptr, want a pointer")
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user