Skip to content

Commit

Permalink
fix: remove usage of deprecated TrackerCounter
Browse files Browse the repository at this point in the history
  • Loading branch information
lchenut committed Jun 28, 2024
1 parent 416ff7b commit f8c1b2f
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions tests/helpers.nim
Original file line number Diff line number Diff line change
Expand Up @@ -22,23 +22,23 @@ template asyncTest*(name: string, body: untyped): untyped =
test name:
waitFor((proc () {.async, gcsafe.} = body)())

iterator testTrackers*(extras: openArray[string] = []): TrackerBase =
iterator testTrackers*(extras: openArray[string] = []): TrackerCounter =
for name in trackerNames:
let t = getTracker(name)
if not isNil(t): yield t
let t = getTrackerCounter(name)
yield t
for name in extras:
let t = getTracker(name)
if not isNil(t): yield t
let t = getTrackerCounter(name)
yield t

template checkTracker*(name: string) =
var tracker = getTracker(name)
if tracker.isLeaked():
var tracker = getTrackerCounter(name)
if tracker.isCounterLeaked():
checkpoint tracker.dump()
fail()

template checkTrackers*() =
for tracker in testTrackers():
if tracker.isLeaked():
if tracker.isCounterLeaked():
checkpoint tracker.dump()
fail()
# Also test the GC is not fooling with us
Expand Down

0 comments on commit f8c1b2f

Please sign in to comment.