Guile cpp11_std_unique_ptr testcase tweaks for use from Racket

This commit is contained in:
William S Fulton 2022-08-18 21:31:20 +01:00
commit 5b16e4fbd3

View file

@ -1,13 +1,13 @@
(define checkCount (define checkCount
(lambda (expected-count) (lambda (expected-count)
(define actual-count (Klass-getTotal-count)) (define actual-count (Klass-getTotal-count))
(if (not (= actual-count expected-count)) (error "Counts incorrect, expected:" expected-count " actual:" actual-count)))) (unless (= actual-count expected-count) (error (format "Counts incorrect, expected:~a actual:~a" expected-count actual-count)))))
; Test raw pointer handling involving virtual inheritance ; Test raw pointer handling involving virtual inheritance
(define kini (new-KlassInheritance "KlassInheritanceInput")) (define kini (new-KlassInheritance "KlassInheritanceInput"))
(checkCount 1) (checkCount 1)
(define s (useKlassRawPtr kini)) (define s (useKlassRawPtr kini))
(if (not (string=? s "KlassInheritanceInput")) (unless (string=? s "KlassInheritanceInput")
(error "Incorrect string: " s)) (error "Incorrect string: " s))
(delete-Klass kini) (delete-Klass kini)
(checkCount 0) (checkCount 0)
@ -17,9 +17,9 @@
(checkCount 1) (checkCount 1)
(define s (takeKlassUniquePtr kin)) (define s (takeKlassUniquePtr kin))
(checkCount 0) (checkCount 0)
(if (not (string=? s "KlassInput")) (unless (string=? s "KlassInput")
(error "Incorrect string: " s)) (error "Incorrect string: " s))
(if (not (is-nullptr kin)) (unless (is-nullptr kin)
(error "is_nullptr failed")) (error "is_nullptr failed"))
(delete-Klass kin) ; Should not fail, even though already deleted (delete-Klass kin) ; Should not fail, even though already deleted
(checkCount 0) (checkCount 0)
@ -28,9 +28,9 @@
(checkCount 1) (checkCount 1)
(define s (takeKlassUniquePtr kin)) (define s (takeKlassUniquePtr kin))
(checkCount 0) (checkCount 0)
(if (not (string=? s "KlassInput")) (unless (string=? s "KlassInput")
(error "Incorrect string: " s)) (error "Incorrect string: " s))
(if (not (is-nullptr kin)) (unless (is-nullptr kin)
(error "is_nullptr failed")) (error "is_nullptr failed"))
(expect-throw 'misc-error (expect-throw 'misc-error
(takeKlassUniquePtr kin)) (takeKlassUniquePtr kin))
@ -51,9 +51,9 @@
(checkCount 1) (checkCount 1)
(define s (takeKlassUniquePtr kini)) (define s (takeKlassUniquePtr kini))
(checkCount 0) (checkCount 0)
(if (not (string=? s "KlassInheritanceInput")) (unless (string=? s "KlassInheritanceInput")
(error "Incorrect string: " s)) (error "Incorrect string: " s))
(if (not (is-nullptr kini)) (unless (is-nullptr kini)
(error "is_nullptr failed")) (error "is_nullptr failed"))
(delete-Klass kini) ; Should not fail, even though already deleted (delete-Klass kini) ; Should not fail, even though already deleted
(checkCount 0) (checkCount 0)
@ -66,7 +66,7 @@
(delete-Klass k1) (delete-Klass k1)
(checkCount 1) (checkCount 1)
(if (not (string=? (Klass-getLabel k2) "second")) (unless (string=? (Klass-getLabel k2) "second")
(error "wrong object label" )) (error "wrong object label" ))
(delete-Klass k2) (delete-Klass k2)