Megatest

Artifact [4bb9f4885a]
Login

Artifact 4bb9f4885af3c44d008278571982da4f8a7a2904:


(use trace test (prefix sqlite3 sqlite3:))
(import dbfile)
(trace-call-sites #t)

(trace
 ;; dbfile:setup
 ;; dbfile:open-sqlite3-db
 ;; dbfile:init-subdb
 ;; dbfile:add-dbdat
 ;; dbfile:set-subdb
 ;; db:with-db
 ;; dbfile:get-subdb
 )

(define tmpdir (common:get-db-tmp-area))
(test #f #t (dbr:dbstruct? (dbfile:setup #t *toppath* tmpdir)))
(test #f #t (dbr:dbstruct? (db:setup #t)))
(define dbstruct *dbstruct-dbs*)
(test #f #f (dbfile:get-subdb dbstruct #f)) ;; get main.db (never opened yet)
(test #f #f (dbfile:get-subdb dbstruct 1))  ;; get 1.db
(test #f #t (hash-table? (dbr:dbstruct-subdbs dbstruct)))
(test #f #t (dbr:dbdat? (dbfile:open-db *dbstruct-dbs* #f db:initialize-main-db)))
(test #f '("SYSTEM" "RELEASE") (db:get-keys *dbstruct-dbs*))
(test #f #f (dbr:dbdat? (dbfile:get-dbdat dbstruct 1))) ;; not open yet
(test #f #f (sqlite3:database? (db:open-db dbstruct #f)))
(test #f #f (sqlite3:database? (db:open-db dbstruct 1)))

;; (test #f #t (stack? (dbr:subdb-dbstack subdb
;; test #f #f (db:get-subdb dbstruct 1))
;; 
;; ; (test #f #f (stack? (dbr:subdb-dbstack subdb)))