X-Git-Url: http://repo.macrolet.net/gitweb/?a=blobdiff_plain;f=tests%2Fprofile.impure.lisp;h=721fdeb9990efef58464f83800273a8dbb987c4f;hb=829ced3e78a23ba153ba4db64e6ea6984c2313b6;hp=ab1c95c50da57056f4aca7717ae118b4301b1ed1;hpb=c461e239d10c94d77649856bbde06431666da4fd;p=sbcl.git diff --git a/tests/profile.impure.lisp b/tests/profile.impure.lisp index ab1c95c..721fdeb 100644 --- a/tests/profile.impure.lisp +++ b/tests/profile.impure.lisp @@ -89,3 +89,16 @@ (unless (equal res want) (error "wanted ~S, got ~S" want res))) (report)) + +(with-test (:name :profiling-counter) + ;; Make sure our profiling counters don't miscount + (let ((c (sb-profile::make-counter)) + (i 0)) + (loop repeat 1000000 + do (let ((n (random (* 12 (ash 1 sb-vm:n-word-bits))))) + (sb-profile::incf-counter c n) + (incf i n)) + (let ((n (random (ash 1 sb-vm:n-word-bits)))) + (sb-profile::incf-counter c n) + (incf i n))) + (assert (= i (sb-profile::counter-count c)))))