OverviewFilesCommitsIssuesDocsReleasesPeers

opencog-atomspace-storage commits / 72d8fbb

Exceptions cannot be thrown; don't test for them
72d8fbb7af923e08b11718d07ff654192a728fb7
by Linas Vepstas <linasvepstas@gmail.com> · 2026-01-18T04:10:23.000Z

Changed files (1) +9 -35

tests/persist/proxy/proxy-node-test.scm +9 -35
……@@ -1,3 +1,6 @@
1#! /usr/bin/env guile
2-s
3!#
14;
25; proxy-node-test.scm -- Unit test for basic ProxyNode syntax.
36;
……@@ -35,6 +38,12 @@
3538
3639(test-assert "Failed to catch exception" caught)
3740
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!?
3847; ----------------------------
3948; Assorted permutations -- just one target
4049
……@@ -45,14 +54,6 @@
4554(cog-set-value! wnull (*-store-atom-*) (Concept "boffo"))
4655(cog-set-value! wnull (*-close-*))
4756
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
5657; ----------------------------
5758; Multiple targets
5859
……@@ -67,15 +68,6 @@
6768(cog-set-value! wmulti (*-store-atom-*) (Concept "boffo"))
6869(cog-set-value! wmulti (*-close-*))
6970
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
7971; ----------------------------
8072; Assorted permutations -- just one reader
8173
……@@ -89,14 +81,6 @@
8981(cog-set-value! rnull (*-fetch-atom-*) (Concept "b4"))
9082(cog-set-value! rnull (*-close-*))
9183
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
10084; ----------------------------
10185; Multiple readers
10286
……@@ -116,16 +100,6 @@
116100(cog-set-value! rmulti (*-fetch-atom-*) (Concept "b6"))
117101(cog-set-value! rmulti (*-close-*))
118102
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
129103(test-end tname)
130104
131105(opencog-test-end)