-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
The crash was reported in #20 The fix is in opencog/atomspace#3037
- Loading branch information
Showing
2 changed files
with
53 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
; | ||
; frame-print-test.scm | ||
; Test for crash (null-pointer deref) for a simple usercase. | ||
; | ||
; The crash was in AtomSpace code. | ||
; See https://github.com/opencog/atomspace-rocks/issues/20 | ||
; for details. | ||
; The fix is in https://github.com/opencog/atomspace/pull/3037 | ||
; | ||
(use-modules (srfi srfi-1)) | ||
(use-modules (opencog) (opencog test-runner)) | ||
(use-modules (opencog persist) (opencog persist-rocks)) | ||
|
||
(include "test-utils.scm") | ||
(whack "/tmp/cog-rocks-unit-test") | ||
|
||
(opencog-test-runner) | ||
|
||
; ------------------------------------------------------------------- | ||
; Test that load of a series of nested links is done correctly. | ||
|
||
(define (test-print) | ||
|
||
(define a (AtomSpace)) | ||
(define b (AtomSpace)) | ||
(define c (AtomSpace a b)) | ||
|
||
(cog-set-atomspace! a) | ||
(Concept "I'm in A") | ||
(cog-prt-atomspace) | ||
|
||
(cog-set-atomspace! b) | ||
(Concept "I'm in B") | ||
(cog-prt-atomspace) | ||
|
||
(cog-set-atomspace! c) | ||
(define rsn (RocksStorageNode "rocks:///tmp/cog-rocks-unit-test")) | ||
(cog-open rsn) | ||
(store-atomspace) | ||
(cog-prt-atomspace) | ||
|
||
(cog-close rsn) | ||
) | ||
|
||
(define test-name "test print") | ||
(test-begin test-name) | ||
(test-print) | ||
(test-end test-name) | ||
|
||
; =================================================================== | ||
(whack "/tmp/cog-rocks-unit-test") | ||
(opencog-test-end) |