ScriptFu: tests: fix tests broken between 2.99 and 3.0rc2
No changes other than to test framework and tests.
This commit is contained in:
parent
ff192d25d3
commit
54a53ae8b7
4 changed files with 27 additions and 20 deletions
|
|
@ -112,7 +112,9 @@
|
|||
; except by proximity in the output.
|
||||
(define (test! string)
|
||||
(displayln "")
|
||||
(displayln string))
|
||||
(displayln string)
|
||||
; also to GIMP Error Console
|
||||
(gimp-message string))
|
||||
|
||||
|
||||
; reset testing state when test framework is loaded
|
||||
|
|
|
|||
|
|
@ -159,7 +159,8 @@
|
|||
; Dimension zero yields error
|
||||
; It does NOT yield invalid ID -1
|
||||
(assert-error `(gimp-image-new 0 0 RGB)
|
||||
"argument 1 in call to gimp-image-new has value 0 out of range: 1 to 524288")
|
||||
"Invalid value for argument 0")
|
||||
; FORMERLY "argument 1 in call to gimp-image-new has value 0 out of range: 1 to 524288")
|
||||
|
||||
; Since 3.0, parameter validation catches this earlier.
|
||||
; Formerly, "Procedure execution of gimp-image-new failed on invalid input arguments: "
|
||||
|
|
|
|||
|
|
@ -45,14 +45,23 @@
|
|||
|
||||
; New with precision
|
||||
|
||||
|
||||
; GAMMA obsolete since 3.0
|
||||
; PRECISION-U8-GAMMA
|
||||
; PRECISION-U16-GAMMA
|
||||
; PRECISION-U32-GAMMA
|
||||
; PRECISION-HALF-GAMMA
|
||||
; PRECISION-FLOAT-GAMMA
|
||||
; PRECISION-DOUBLE-GAMMA
|
||||
|
||||
; setup
|
||||
(define testImageWithPrecision (car (gimp-image-new-with-precision 21 22 RGB PRECISION-DOUBLE-GAMMA)))
|
||||
(define testImageWithPrecision (car (gimp-image-new-with-precision 21 22 RGB PRECISION-U8-PERCEPTUAL)))
|
||||
|
||||
|
||||
; image has given precision
|
||||
(assert `(=
|
||||
(car (gimp-image-get-precision ,testImageWithPrecision))
|
||||
PRECISION-DOUBLE-GAMMA ))
|
||||
PRECISION-U8-PERCEPTUAL ))
|
||||
|
||||
|
||||
|
||||
|
|
@ -63,9 +72,8 @@
|
|||
,testImage
|
||||
,precision))))
|
||||
|
||||
; First convert away from first precision in list:
|
||||
; Assert precision is not first precision in list:
|
||||
; it will fail if image already that precision
|
||||
(gimp-image-convert-precision testImage PRECISION-U8-NON-LINEAR)
|
||||
|
||||
(define allPrecisions
|
||||
`(PRECISION-U8-LINEAR
|
||||
|
|
@ -85,13 +93,7 @@
|
|||
PRECISION-FLOAT-PERCEPTUAL
|
||||
PRECISION-DOUBLE-LINEAR
|
||||
PRECISION-DOUBLE-NON-LINEAR
|
||||
PRECISION-DOUBLE-PERCEPTUAL
|
||||
PRECISION-U8-GAMMA
|
||||
PRECISION-U16-GAMMA
|
||||
PRECISION-U32-GAMMA
|
||||
PRECISION-HALF-GAMMA
|
||||
PRECISION-FLOAT-GAMMA
|
||||
PRECISION-DOUBLE-GAMMA))
|
||||
PRECISION-DOUBLE-PERCEPTUAL))
|
||||
|
||||
; sequence through all precisions, converting testImage to them
|
||||
(for-each
|
||||
|
|
|
|||
|
|
@ -23,7 +23,7 @@
|
|||
FALSE) ; not closed
|
||||
|
||||
; make test harder by using float precision
|
||||
(gimp-image-convert-precision testImage PRECISION-DOUBLE-GAMMA)
|
||||
(gimp-image-convert-precision testImage PRECISION-DOUBLE-NON-LINEAR)
|
||||
; ensure testing is stroking with paint (versus line)
|
||||
(gimp-context-set-stroke-method STROKE-PAINT-METHOD)
|
||||
; ensure testing is painting with paintbrush (versus pencil, airbrush, etc.)
|
||||
|
|
@ -38,7 +38,8 @@
|
|||
|
||||
; introspection: gimp module returns list of names of dynamics
|
||||
; second arg is a regex
|
||||
(assert `(list? (gimp-dynamics-get-list "")))
|
||||
; FORMERLY get-list
|
||||
(assert `(list? (gimp-dynamics-get-name-list "")))
|
||||
|
||||
; refresh: gimp module will load newly installed dynamics
|
||||
; method is void and should never fail.
|
||||
|
|
@ -67,9 +68,10 @@
|
|||
|
||||
|
||||
; the dynamics setting can be set to the name of a dynamics
|
||||
(assert `(gimp-context-set-dynamics "Tilt Angle"))
|
||||
; setting to false was effective
|
||||
(assert `(string=? (car (gimp-context-get-dynamics))
|
||||
(assert `(gimp-context-set-dynamics-name "Tilt Angle"))
|
||||
; setting was effective
|
||||
; formerly context-[set,get]-dynamics
|
||||
(assert `(string=? (car (gimp-context-get-dynamics-name))
|
||||
"Tilt Angle"))
|
||||
|
||||
|
||||
|
|
@ -81,11 +83,11 @@
|
|||
; stroke a drawable along a path with current brush and dynamics
|
||||
|
||||
|
||||
(define dynamicsList (car (gimp-dynamics-get-list "")))
|
||||
(define dynamicsList (car (gimp-dynamics-get-name-list "")))
|
||||
|
||||
(define (testDynamics dynamics)
|
||||
; Test that every dynamics can be set on the context
|
||||
(gimp-context-set-dynamics dynamics)
|
||||
(gimp-context-set-dynamics-name dynamics)
|
||||
|
||||
(display dynamics)
|
||||
; paint with paintbrush and dynamics, under the test harness
|
||||
|
|
|
|||
Loading…
Reference in a new issue