@@ -136,33 +136,30 @@ (if (member item valid-values) item #f) item))) (define (items:get-items-from-config tconfig) - (let* (;; db is always at *toppath*/db/megatest.db - (items (hash-table-ref/default tconfig "items" #f)) - (itemstable (hash-table-ref/default tconfig "itemstable" #f))) + (let* ((have-items (hash-table-ref/default tconfig "items" #f)) + (have-itable (hash-table-ref/default tconfig "itemstable" #f)) + (items (hash-table-ref/default tconfig "items" '())) + (itemstable (hash-table-ref/default tconfig "itemstable" '()))) (debug:print 5 "items: " items " itemstable: " itemstable) - (if items - (set! items (map (lambda (item) - (if (procedure? (cadr item)) - (list (car item)((cadr item))) - item)) - items))) - (if itemstable - (set! itemstable (map (lambda (item) - (if (procedure? (cadr item)) - (list (car item)((cadr item))) - item)) - itemstable))) - (if (and items (null? items)) - (debug:print 0 "ERROR: You have an [items] section in your testconfig but there were no items define!")) - (if (and itemstable (null? itemstable)) - (debug:print 0 "ERROR: You have an [itemstable] section in your testconfig but there were no entries defined!")) + (set! items (map (lambda (item) + (if (procedure? (cadr item)) + (list (car item)((cadr item))) + item)) + items)) + (set! itemstable (map (lambda (item) + (if (procedure? (cadr item)) + (list (car item)((cadr item))) + item)) + itemstable)) + (if (and have-items (null? items)) (debug:print 0 "ERROR: [items] section in testconfig but no entries defined")) + (if (and have-itable (null? itemstable))(debug:print 0 "ERROR: [itemstable] section in testconfig but no entries defined")) (if (or (not (null? items))(not (null? itemstable))) - (append (if items (item-assoc->item-list items) '()) - (if itemstable (item-table->item-list itemstable) '())) + (append (item-assoc->item-list items) + (item-table->item-list itemstable)) '(())))) ;; (pp (item-assoc->item-list itemdat))