mirror of
https://github.com/isar/rusqlite.git
synced 2024-11-26 19:41:37 +08:00
Minalist check that there is no memory leak.
This commit is contained in:
parent
e040dc9e1f
commit
b135c6d871
@ -197,11 +197,13 @@ mod test {
|
|||||||
let mut stmt = db.prepare("SELECT value from rarray(?);").unwrap();
|
let mut stmt = db.prepare("SELECT value from rarray(?);").unwrap();
|
||||||
|
|
||||||
let rows = stmt.query_map(&[&ptr], |row| row.get::<_, i64>(0)).unwrap();
|
let rows = stmt.query_map(&[&ptr], |row| row.get::<_, i64>(0)).unwrap();
|
||||||
|
assert_eq!(2, Rc::strong_count(&ptr));
|
||||||
let mut count = 0;
|
let mut count = 0;
|
||||||
for (i, value) in rows.enumerate() {
|
for (i, value) in rows.enumerate() {
|
||||||
assert_eq!(i as i64, value.unwrap()-1);
|
assert_eq!(i as i64, value.unwrap()-1);
|
||||||
count += 1;
|
count += 1;
|
||||||
}
|
}
|
||||||
assert_eq!(4, count);
|
assert_eq!(4, count);
|
||||||
|
assert_eq!(1, Rc::strong_count(&ptr));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user