From 5b16e4fbd39b6c089e2b5e573e5516765fee92fb Mon Sep 17 00:00:00 2001 From: William S Fulton Date: Thu, 18 Aug 2022 21:31:20 +0100 Subject: [PATCH] Guile cpp11_std_unique_ptr testcase tweaks for use from Racket --- .../schemerunme/cpp11_std_unique_ptr.scm | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/Examples/test-suite/schemerunme/cpp11_std_unique_ptr.scm b/Examples/test-suite/schemerunme/cpp11_std_unique_ptr.scm index 1a32d08d1..97ecaaf54 100644 --- a/Examples/test-suite/schemerunme/cpp11_std_unique_ptr.scm +++ b/Examples/test-suite/schemerunme/cpp11_std_unique_ptr.scm @@ -1,13 +1,13 @@ (define checkCount (lambda (expected-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 (define kini (new-KlassInheritance "KlassInheritanceInput")) (checkCount 1) (define s (useKlassRawPtr kini)) -(if (not (string=? s "KlassInheritanceInput")) +(unless (string=? s "KlassInheritanceInput") (error "Incorrect string: " s)) (delete-Klass kini) (checkCount 0) @@ -17,9 +17,9 @@ (checkCount 1) (define s (takeKlassUniquePtr kin)) (checkCount 0) -(if (not (string=? s "KlassInput")) +(unless (string=? s "KlassInput") (error "Incorrect string: " s)) -(if (not (is-nullptr kin)) +(unless (is-nullptr kin) (error "is_nullptr failed")) (delete-Klass kin) ; Should not fail, even though already deleted (checkCount 0) @@ -28,9 +28,9 @@ (checkCount 1) (define s (takeKlassUniquePtr kin)) (checkCount 0) -(if (not (string=? s "KlassInput")) +(unless (string=? s "KlassInput") (error "Incorrect string: " s)) -(if (not (is-nullptr kin)) +(unless (is-nullptr kin) (error "is_nullptr failed")) (expect-throw 'misc-error (takeKlassUniquePtr kin)) @@ -51,9 +51,9 @@ (checkCount 1) (define s (takeKlassUniquePtr kini)) (checkCount 0) -(if (not (string=? s "KlassInheritanceInput")) +(unless (string=? s "KlassInheritanceInput") (error "Incorrect string: " s)) -(if (not (is-nullptr kini)) +(unless (is-nullptr kini) (error "is_nullptr failed")) (delete-Klass kini) ; Should not fail, even though already deleted (checkCount 0) @@ -66,7 +66,7 @@ (delete-Klass k1) (checkCount 1) -(if (not (string=? (Klass-getLabel k2) "second")) +(unless (string=? (Klass-getLabel k2) "second") (error "wrong object label" )) (delete-Klass k2)