| … | … | @@ -1,3 +1,6 @@ |
| 1 | #! /usr/bin/env guile |
| 2 | -s |
| 3 | !# |
| 1 | 4 | ; |
| 2 | 5 | ; proxy-node-test.scm -- Unit test for basic ProxyNode syntax. |
| 3 | 6 | ; |
| … | … | @@ -35,6 +38,12 @@ |
| 35 | 38 | |
| 36 | 39 | (test-assert "Failed to catch exception" caught) |
| 37 | 40 | |
| 41 | ; ---------------------------- |
| 42 | ; XXX FIXME ... Right now, all that we hope for is that nothing crashes |
| 43 | ; or hangs in the below, so that's OK. In the past, these also checked |
| 44 | ; for exceptions to be thrown, but the new design does not have any |
| 45 | ; code paths that throw, so the below is pretty boring. Maybe it should |
| 46 | ; be fixed to do some kind of more exciting testing!? |
| 38 | 47 | ; ---------------------------- |
| 39 | 48 | ; Assorted permutations -- just one target |
| 40 | 49 | |
| … | … | @@ -45,14 +54,6 @@ |
| 45 | 54 | (cog-set-value! wnull (*-store-atom-*) (Concept "boffo")) |
| 46 | 55 | (cog-set-value! wnull (*-close-*)) |
| 47 | 56 | |
| 48 | | (set! caught #f) |
| 49 | | (catch 'C++-EXCEPTION (lambda () (cog-set-value! wnull (*-store-atom-*) (Concept "boffo"))) |
| 50 | | (lambda (key funcname msg) |
| 51 | | (format #t "Yes, we got the exception as expected\n") |
| 52 | | (set! caught #t))) |
| 53 | | |
| 54 | | (test-assert "Failed to catch exception" caught) |
| 55 | | |
| 56 | 57 | ; ---------------------------- |
| 57 | 58 | ; Multiple targets |
| 58 | 59 | |
| … | … | @@ -67,15 +68,6 @@ |
| 67 | 68 | (cog-set-value! wmulti (*-store-atom-*) (Concept "boffo")) |
| 68 | 69 | (cog-set-value! wmulti (*-close-*)) |
| 69 | 70 | |
| 70 | | (set! caught #f) |
| 71 | | (catch 'C++-EXCEPTION (lambda () (cog-set-value! wmulti (*-store-atom-*) (Concept "boffo"))) |
| 72 | | (lambda (key funcname msg) |
| 73 | | (format #t "Yes, we got the exception as expected\n") |
| 74 | | (set! caught #t))) |
| 75 | | |
| 76 | | (test-assert "Failed to catch exception" caught) |
| 77 | | |
| 78 | | |
| 79 | 71 | ; ---------------------------- |
| 80 | 72 | ; Assorted permutations -- just one reader |
| 81 | 73 | |
| … | … | @@ -89,14 +81,6 @@ |
| 89 | 81 | (cog-set-value! rnull (*-fetch-atom-*) (Concept "b4")) |
| 90 | 82 | (cog-set-value! rnull (*-close-*)) |
| 91 | 83 | |
| 92 | | (set! caught #f) |
| 93 | | (catch 'C++-EXCEPTION (lambda () (cog-set-value! rnull (*-fetch-atom-*) (Concept "boffo"))) |
| 94 | | (lambda (key funcname msg) |
| 95 | | (format #t "Yes, we got the exception as expected\n") |
| 96 | | (set! caught #t))) |
| 97 | | |
| 98 | | (test-assert "Failed to catch exception" caught) |
| 99 | | |
| 100 | 84 | ; ---------------------------- |
| 101 | 85 | ; Multiple readers |
| 102 | 86 | |
| … | … | @@ -116,16 +100,6 @@ |
| 116 | 100 | (cog-set-value! rmulti (*-fetch-atom-*) (Concept "b6")) |
| 117 | 101 | (cog-set-value! rmulti (*-close-*)) |
| 118 | 102 | |
| 119 | | (set! caught #f) |
| 120 | | (catch 'C++-EXCEPTION (lambda () (cog-set-value! rmulti (*-fetch-atom-*) (Concept "boffo"))) |
| 121 | | (lambda (key funcname msg) |
| 122 | | (format #t "Yes, we got the exception as expected\n") |
| 123 | | (set! caught #t))) |
| 124 | | |
| 125 | | (test-assert "Failed to catch exception" caught) |
| 126 | | |
| 127 | | |
| 128 | | |
| 129 | 103 | (test-end tname) |
| 130 | 104 | |
| 131 | 105 | (opencog-test-end) |