@@ -70,10 +70,22 @@ defineSuite([
70
70
expect ( CesiumMath . toRadians ( 360.0 ) ) . toEqual ( 2 * Math . PI ) ;
71
71
} ) ;
72
72
73
+ it ( 'toRadians throws for undefined' , function ( ) {
74
+ expect ( function ( ) {
75
+ CesiumMath . toRadians ( ) ;
76
+ } ) . toThrowDeveloperError ( ) ;
77
+ } ) ;
78
+
73
79
it ( 'toDegrees' , function ( ) {
74
80
expect ( CesiumMath . toDegrees ( Math . PI ) ) . toEqual ( 180.0 ) ;
75
81
} ) ;
76
82
83
+ it ( 'toDegrees throws for undefined' , function ( ) {
84
+ expect ( function ( ) {
85
+ CesiumMath . toDegrees ( ) ;
86
+ } ) . toThrowDeveloperError ( ) ;
87
+ } ) ;
88
+
77
89
it ( 'convertLongitudeRange (1)' , function ( ) {
78
90
expect ( CesiumMath . convertLongitudeRange ( CesiumMath . THREE_PI_OVER_TWO ) ) . toEqualEpsilon ( - CesiumMath . PI_OVER_TWO , CesiumMath . EPSILON16 ) ;
79
91
} ) ;
@@ -86,6 +98,12 @@ defineSuite([
86
98
expect ( CesiumMath . convertLongitudeRange ( Math . PI ) ) . toEqualEpsilon ( - Math . PI , CesiumMath . EPSILON16 ) ;
87
99
} ) ;
88
100
101
+ it ( 'convertLongitudeRange throws for undefined' , function ( ) {
102
+ expect ( function ( ) {
103
+ CesiumMath . convertLongitudeRange ( ) ;
104
+ } ) . toThrowDeveloperError ( ) ;
105
+ } ) ;
106
+
89
107
it ( 'negativePiToPi positive' , function ( ) {
90
108
expect ( CesiumMath . negativePiToPi ( ( Math . PI / 2 ) * Math . PI ) ) . toEqualEpsilon ( ( Math . PI / 2 ) * Math . PI - CesiumMath . TWO_PI , CesiumMath . EPSILON16 ) ;
91
109
expect ( CesiumMath . negativePiToPi ( Math . PI / 0.5 ) ) . toEqualEpsilon ( 0.0 , CesiumMath . EPSILON16 ) ;
@@ -103,6 +121,36 @@ defineSuite([
103
121
expect ( CesiumMath . negativePiToPi ( - Math . PI + 1 ) ) . toEqualEpsilon ( - Math . PI + 1 , CesiumMath . EPSILON16 ) ;
104
122
} ) ;
105
123
124
+ it ( 'negativePiToPi throws for undefined' , function ( ) {
125
+ expect ( function ( ) {
126
+ CesiumMath . negativePiToPi ( ) ;
127
+ } ) . toThrowDeveloperError ( ) ;
128
+ } ) ;
129
+
130
+ it ( 'zeroToTwoPi throws for undefined' , function ( ) {
131
+ expect ( function ( ) {
132
+ CesiumMath . zeroToTwoPi ( ) ;
133
+ } ) . toThrowDeveloperError ( ) ;
134
+ } ) ;
135
+
136
+ it ( 'equalsEpsilon throws for undefined left' , function ( ) {
137
+ expect ( function ( ) {
138
+ CesiumMath . equalsEpsilon ( undefined , 5.0 , CesiumMath . EPSILON16 ) ;
139
+ } ) . toThrowDeveloperError ( ) ;
140
+ } ) ;
141
+
142
+ it ( 'equalsEpsilon throws for undefined right' , function ( ) {
143
+ expect ( function ( ) {
144
+ CesiumMath . equalsEpsilon ( 1.0 , undefined , CesiumMath . EPSILON16 ) ;
145
+ } ) . toThrowDeveloperError ( ) ;
146
+ } ) ;
147
+
148
+ it ( 'equalsEpsilon throws for undefined' , function ( ) {
149
+ expect ( function ( ) {
150
+ CesiumMath . equalsEpsilon ( ) ;
151
+ } ) . toThrowDeveloperError ( ) ;
152
+ } ) ;
153
+
106
154
it ( 'factorial produces the correct results' , function ( ) {
107
155
var factorials = [ 1 , 1 , 2 , 6 , 24 , 120 , 720 , 5040 , 40320 , 362880 , 3628800 , 39916800 , 479001600 , 6227020800 , 87178291200 , 1307674368000 , 20922789888000 , 355687428096000 , 6402373705728000 ,
108
156
121645100408832000 , 2432902008176640000 , 51090942171709440000 , 1124000727777607680000 , 25852016738884976640000 , 620448401733239439360000 ] ;
@@ -118,6 +166,12 @@ defineSuite([
118
166
expect ( CesiumMath . incrementWrap ( 10 , 10 ) ) . toEqual ( 0 ) ;
119
167
} ) ;
120
168
169
+ it ( 'incrementWrap throws for undefined' , function ( ) {
170
+ expect ( function ( ) {
171
+ CesiumMath . incrementWrap ( ) ;
172
+ } ) . toThrowDeveloperError ( ) ;
173
+ } ) ;
174
+
121
175
it ( 'isPowerOfTwo finds powers of two' , function ( ) {
122
176
expect ( CesiumMath . isPowerOfTwo ( 1 ) ) . toEqual ( true ) ;
123
177
expect ( CesiumMath . isPowerOfTwo ( 2 ) ) . toEqual ( true ) ;
@@ -205,4 +259,10 @@ defineSuite([
205
259
CesiumMath . nextPowerOfTwo ( ) ;
206
260
} ) . toThrowDeveloperError ( ) ;
207
261
} ) ;
262
+
263
+ it ( 'clamp throws for undefined' , function ( ) {
264
+ expect ( function ( ) {
265
+ CesiumMath . clamp ( ) ;
266
+ } ) . toThrowDeveloperError ( ) ;
267
+ } ) ;
208
268
} ) ;
0 commit comments