From 65a03cf70e4e2260780606f8b52e199cc9c8488c Mon Sep 17 00:00:00 2001 From: Norbert Hartl Date: Wed, 15 Jul 2020 16:49:40 +0200 Subject: [PATCH] Changed GError for the same reason as GObject --- src/Geometry-Tests/GAngleTest.class.st | 2 +- src/Geometry-Tests/GPointTest.class.st | 2 +- src/Geometry-Tests/GPolygonTest.class.st | 2 +- src/Geometry-Tests/GRectangleTest.class.st | 4 ++-- src/Geometry-Tests/GTestCase.class.st | 4 ++-- src/Geometry/GLine.class.st | 4 ++-- src/Geometry/{GError.class.st => GeometryError.class.st} | 2 +- src/Geometry/GeometryObject.class.st | 4 ++-- 8 files changed, 12 insertions(+), 12 deletions(-) rename src/Geometry/{GError.class.st => GeometryError.class.st} (86%) diff --git a/src/Geometry-Tests/GAngleTest.class.st b/src/Geometry-Tests/GAngleTest.class.st index 2334ac2..5c4cd85 100644 --- a/src/Geometry-Tests/GAngleTest.class.st +++ b/src/Geometry-Tests/GAngleTest.class.st @@ -181,7 +181,7 @@ GAngleTest >> testMultiplication [ self assert: angle * 2 equals: 180 degrees. self assert: 2 * angle equals: 180 degrees. self assert: angle * 1 equals: 90 degrees. - self should: [ angle * 10 degrees ] raise: GError description: 'It should not be possible to multiple two angles' + self should: [ angle * 10 degrees ] raise: GeometryError description: 'It should not be possible to multiple two angles' ] { #category : #tests } diff --git a/src/Geometry-Tests/GPointTest.class.st b/src/Geometry-Tests/GPointTest.class.st index 2058914..b92672c 100644 --- a/src/Geometry-Tests/GPointTest.class.st +++ b/src/Geometry-Tests/GPointTest.class.st @@ -211,5 +211,5 @@ GPointTest >> testTranslateBy [ { #category : #tests } GPointTest >> testWithCollection [ self assert: (GPoint withCollection: #(1 2)) equals: 1 , 2. - self should: [ GPoint withCollection: #() ] raise: GError + self should: [ GPoint withCollection: #() ] raise: GeometryError ] diff --git a/src/Geometry-Tests/GPolygonTest.class.st b/src/Geometry-Tests/GPolygonTest.class.st index 20406a7..1c66cf9 100644 --- a/src/Geometry-Tests/GPolygonTest.class.st +++ b/src/Geometry-Tests/GPolygonTest.class.st @@ -251,7 +251,7 @@ GPolygonTest >> testScaleBy [ polygon scaleBy: 1 / 2. self assert: polygon vertices equals: {(5 , 2) . (-2 , 5) . (-5 , -5)}. - self should: [ polygon scaleBy: 0 ] raise: GError + self should: [ polygon scaleBy: 0 ] raise: GeometryError ] { #category : #tests } diff --git a/src/Geometry-Tests/GRectangleTest.class.st b/src/Geometry-Tests/GRectangleTest.class.st index 73c1936..a6f3f0b 100644 --- a/src/Geometry-Tests/GRectangleTest.class.st +++ b/src/Geometry-Tests/GRectangleTest.class.st @@ -127,8 +127,8 @@ GRectangleTest >> testIntersectionsWithRay [ { #category : #tests } GRectangleTest >> testVertices [ - self should: [ GRectangle vertices: {(1 , 1) . (2 , 2) . (3 , 5)} ] raise: GError. - self should: [ GRectangle vertices: {(0 , 0) . (2 , 0) . (2 , -2) . (-1 , -2)} ] raise: GError + self should: [ GRectangle vertices: {(1 , 1) . (2 , 2) . (3 , 5)} ] raise: GeometryError. + self should: [ GRectangle vertices: {(0 , 0) . (2 , 0) . (2 , -2) . (-1 , -2)} ] raise: GeometryError ] { #category : #tests } diff --git a/src/Geometry-Tests/GTestCase.class.st b/src/Geometry-Tests/GTestCase.class.st index f5429ce..26fba95 100644 --- a/src/Geometry-Tests/GTestCase.class.st +++ b/src/Geometry-Tests/GTestCase.class.st @@ -53,6 +53,6 @@ GTestCase >> testEquals [ { #category : #tests } GTestCase >> testErrorsArePersonnalized [ - self should: [ self newInstance error ] raise: GError. - self should: [ self newInstance error: 'Error' ] raise: GError + self should: [ self newInstance error ] raise: GeometryError. + self should: [ self newInstance error: 'Error' ] raise: GeometryError ] diff --git a/src/Geometry/GLine.class.st b/src/Geometry/GLine.class.st index c99a551..6091487 100644 --- a/src/Geometry/GLine.class.st +++ b/src/Geometry/GLine.class.st @@ -67,7 +67,7 @@ GLine >> = line [ (self isParallelTo: line) ifFalse: [ ^ false ]. ^ [ (self yFor: 1) =~ (line yFor: 1) ] - on: GError + on: GeometryError do: [ "This can happen if b = 0" (self xFor: 1) =~ (line xFor: 1) ] ] @@ -117,7 +117,7 @@ GLine >> distanceTo: aGPoint [ { #category : #comparing } GLine >> hash [ ^ ([ self yFor: 1 ] - on: GError + on: GeometryError do: [ "This can happen if b = 0" self xFor: 1 ]) hash ] diff --git a/src/Geometry/GError.class.st b/src/Geometry/GeometryError.class.st similarity index 86% rename from src/Geometry/GError.class.st rename to src/Geometry/GeometryError.class.st index 37a6d38..e4a17b2 100644 --- a/src/Geometry/GError.class.st +++ b/src/Geometry/GeometryError.class.st @@ -5,7 +5,7 @@ Description I am a common exception for the Geometry project " Class { - #name : #GError, + #name : #GeometryError, #superclass : #Error, #category : #'Geometry-Exceptions' } diff --git a/src/Geometry/GeometryObject.class.st b/src/Geometry/GeometryObject.class.st index 9d4952a..15c338b 100644 --- a/src/Geometry/GeometryObject.class.st +++ b/src/Geometry/GeometryObject.class.st @@ -12,12 +12,12 @@ Class { { #category : #'error handling' } GeometryObject class >> error [ - GError signal + GeometryError signal ] { #category : #'error handling' } GeometryObject class >> error: aString [ - GError signal: aString + GeometryError signal: aString ] { #category : #'error handling' }