vlib: enable more satnitized memleak detection runs without false positives on the CI (#23200)

This commit is contained in:
Felipe Pena 2024-12-20 11:09:16 -03:00 committed by GitHub
parent 903e349a7c
commit b0772193f8
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
16 changed files with 89 additions and 22 deletions

View file

@ -20,7 +20,7 @@ struct Baby {
}
fn test_main() {
db := sqlite.connect(':memory:')!
mut db := sqlite.connect(':memory:')!
sql db {
create table Parent
@ -80,4 +80,6 @@ fn test_main() {
assert parent[0].children[0].id == 1
assert parent[0].children[1].id == 2
assert parent[0].children.len == 2
db.close()!
}

View file

@ -22,7 +22,7 @@ fn records_by_field[T](db sqlite.DB, fieldname string, value string) ![]T {
}
fn test_main() {
db := sqlite.connect(':memory:')!
mut db := sqlite.connect(':memory:')!
sql db {
create table Blog
}!
@ -40,4 +40,5 @@ fn test_main() {
return
}
assert rows.len == 1
db.close()!
}

View file

@ -11,7 +11,7 @@ pub:
type Content = []u8 | string
struct Host {
pub:
pub mut:
db Connection
}
@ -92,7 +92,8 @@ fn test_can_access_sqlite_result_consts() {
}
fn test_alias_db() {
create_host(sqlite.connect(':memory:')!)!
mut host := create_host(sqlite.connect(':memory:')!)!
host.db.close()!
assert true
}
@ -110,7 +111,9 @@ fn test_exec_param_many() {
'Sam',
]) or {
assert err.code() == 19 // constraint failure
db.close()!
return
}
db.close()!
assert false
}