Skip to content

Commit

Permalink
Make cairo render tests independent from Pharo system icons
Browse files Browse the repository at this point in the history
Fixes #56
  • Loading branch information
tinchodias committed May 2, 2024
1 parent d3cbe05 commit bb97352
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 6 deletions.
9 changes: 4 additions & 5 deletions src/Alexandrie-Cairo-Tests/AeCairoExamplesRenderTest.class.st
Expand Up @@ -93,7 +93,7 @@ AeCairoExamplesRenderTest >> surfaceWithAllOperators [
AeCairoExamplesRenderTest >> surfaceWithColoredIcons [

| inputForm inputSurface outputColors outputSurface outputContext |
inputForm := self iconNamed: #windowClose.
inputForm := Form fromFileNamed: AeFilesystemResources removeIconPNG.
inputSurface := AeCairoImageSurface fromForm: inputForm.

outputColors := Color wheel: 7.
Expand Down Expand Up @@ -352,7 +352,7 @@ AeCairoExamplesRenderTest >> surfaceWithGouraudBasedTriangle [
AeCairoExamplesRenderTest >> surfaceWithPixelatedIcon [

| iconForm iconSurface iconPattern scale aSurface aContext |
iconForm := Smalltalk ui icons iconNamed: #removeIcon.
iconForm := Form fromFileNamed: AeFilesystemResources removeIconPNG.
iconSurface := AeCairoImageSurface fromForm: iconForm.
iconPattern := AeCairoSurfacePattern surface: iconSurface.
scale := 5.0.
Expand Down Expand Up @@ -604,10 +604,9 @@ AeCairoExamplesRenderTest >> surfaceWithStraightEdgesCurve [
AeCairoExamplesRenderTest >> surfaceWithStretchedIcon [

| aSurface aContext iconForm iconSurface iconPattern horizontalScale verticalScale |
iconForm := Smalltalk ui icons iconNamed: #classIcon.
self assert: iconForm extent = (16@16).
iconForm := Form fromFileNamed: AeFilesystemResources removeIconPNG.
horizontalScale := 0.5.
verticalScale := 4.0.
verticalScale := 2.0.

iconSurface := AeCairoImageSurface fromForm: iconForm.
iconPattern := AeCairoSurfacePattern surface: iconSurface.
Expand Down
Expand Up @@ -41,7 +41,7 @@ AeCairoImageSurfaceTest >> testExtentFormat [
AeCairoImageSurfaceTest >> testFromForm [

| aForm |
aForm := Smalltalk ui icons iconNamed: #classIcon.
aForm := Form fromFileNamed: AeFilesystemResources removeIconPNG.
surface := AeCairoImageSurface fromForm: aForm.

self assert: surface extent equals: aForm extent
Expand Down
12 changes: 12 additions & 0 deletions src/Alexandrie-Cairo-Tests/AeFilesystemResources.extension.st
Expand Up @@ -5,3 +5,15 @@ AeFilesystemResources class >> cairoDirectory [

^ self testsDirectory / 'cairo'
]

{ #category : #'*Alexandrie-Cairo-Tests' }
AeFilesystemResources class >> imagesDirectory [

^ self testsDirectory / 'images'
]

{ #category : #'*Alexandrie-Cairo-Tests' }
AeFilesystemResources class >> removeIconPNG [

^ self imagesDirectory / 'removeIcon.png'
]

0 comments on commit bb97352

Please sign in to comment.