[c++options] Convert trep-engine, trep-based-reports, and tests to new API

This commit is contained in:
John Ralls
2022-12-23 09:57:23 -08:00
parent 3c406c9374
commit 58147ea470
3 changed files with 10 additions and 15 deletions

View File

@@ -43,10 +43,9 @@
(gnc:options->sxml rpt-uuid options "test-gstr" test-title))
(define (set-option! options section name value)
(let ((option (gnc:lookup-option options section name)))
(if option
(gnc:option-set-value option value)
(test-assert (format #f "wrong-option ~a ~a" section name) #f))))
(if (gnc-lookup-option options section name)
(gnc-set-option options section name value)
(test-assert (format #f "wrong-option ~a ~a" section name) #f)))
(define* (create-txn d m y desc splits #:optional txn-type)
(let* ((splits (map (lambda (s) (vector (cdr s) (car s) (car s))) splits))

View File

@@ -102,15 +102,13 @@
(sxml->table-row-col sxml 1 row col))
(define (set-option! options section name value)
(let ((option (gnc:lookup-option options section name)))
(if option
(gnc:option-set-value option value)
(test-assert (format #f "wrong-option ~a ~a" section name) #f))))
(if (gnc-lookup-option options section name)
(gnc-set-option options section name value)
(test-assert (format #f "wrong-option ~a ~a" section name) #f)))
(define (opt-val options section name)
(let ((option (gnc:lookup-option options section name)))
(if option
(gnc:option-value option)
(test-assert (format #f "wrong-option ~a ~a" section name) #f))))
(if (gnc-lookup-option options section name)
(gnc-get-option options section name value)
(test-assert (format #f "wrong-option ~a ~a" section name) #f)))
(define structure
(list "Root" (list (cons 'type ACCT-TYPE-ASSET))

View File

@@ -990,9 +990,7 @@ be excluded from periodic reporting.")
(gnc-register-internal-option options "__trep" "unique-transactions" #f)
(GncOptionDBPtr-set-default-section options gnc:pagename-general)
;; A temporary hack so that trep users will get the options type they expect.
(lambda (key)
options)))
options))
;; ;;;;;;;;;;;;;;;;;;;;
;; Here comes the big function that builds the whole table.