@@ -38,7 +38,8 @@ const expectedErrorRegexp = /^TypeError: size must be a number >= 0$/;
38
38
[ crypto . randomBytes , crypto . pseudoRandomBytes ] . forEach ( function ( f ) {
39
39
[ - 1 , undefined , null , false , true , { } , [ ] ] . forEach ( function ( value ) {
40
40
assert . throws ( function ( ) { f ( value ) ; } , expectedErrorRegexp ) ;
41
- assert . throws ( function ( ) { f ( value , common . noop ) ; } , expectedErrorRegexp ) ;
41
+ assert . throws ( function ( ) { f ( value , common . mustNotCall ( ) ) ; } ,
42
+ expectedErrorRegexp ) ;
42
43
} ) ;
43
44
44
45
[ 0 , 1 , 2 , 4 , 16 , 256 , 1024 ] . forEach ( function ( len ) {
@@ -153,11 +154,11 @@ const expectedErrorRegexp = /^TypeError: size must be a number >= 0$/;
153
154
} , / o f f s e t m u s t b e a n u m b e r / ) ;
154
155
155
156
assert . throws ( ( ) => {
156
- crypto . randomFill ( buf , 'test' , common . noop ) ;
157
+ crypto . randomFill ( buf , 'test' , common . mustNotCall ( ) ) ;
157
158
} , / o f f s e t m u s t b e a n u m b e r / ) ;
158
159
159
160
assert . throws ( ( ) => {
160
- crypto . randomFill ( buf , NaN , common . noop ) ;
161
+ crypto . randomFill ( buf , NaN , common . mustNotCall ( ) ) ;
161
162
} , / o f f s e t m u s t b e a n u m b e r / ) ;
162
163
163
164
const max = require ( 'buffer' ) . kMaxLength + 1 ;
@@ -171,11 +172,11 @@ const expectedErrorRegexp = /^TypeError: size must be a number >= 0$/;
171
172
} , / o f f s e t o u t o f r a n g e / ) ;
172
173
173
174
assert . throws ( ( ) => {
174
- crypto . randomFill ( buf , 11 , common . noop ) ;
175
+ crypto . randomFill ( buf , 11 , common . mustNotCall ( ) ) ;
175
176
} , / o f f s e t o u t o f r a n g e / ) ;
176
177
177
178
assert . throws ( ( ) => {
178
- crypto . randomFill ( buf , max , common . noop ) ;
179
+ crypto . randomFill ( buf , max , common . mustNotCall ( ) ) ;
179
180
} , / o f f s e t o u t o f r a n g e / ) ;
180
181
181
182
assert . throws ( ( ) => {
@@ -187,11 +188,11 @@ const expectedErrorRegexp = /^TypeError: size must be a number >= 0$/;
187
188
} , / s i z e m u s t b e a n u m b e r / ) ;
188
189
189
190
assert . throws ( ( ) => {
190
- crypto . randomFill ( buf , 0 , 'test' , common . noop ) ;
191
+ crypto . randomFill ( buf , 0 , 'test' , common . mustNotCall ( ) ) ;
191
192
} , / s i z e m u s t b e a n u m b e r / ) ;
192
193
193
194
assert . throws ( ( ) => {
194
- crypto . randomFill ( buf , 0 , NaN , common . noop ) ;
195
+ crypto . randomFill ( buf , 0 , NaN , common . mustNotCall ( ) ) ;
195
196
} , / s i z e m u s t b e a n u m b e r / ) ;
196
197
197
198
{
@@ -206,11 +207,11 @@ const expectedErrorRegexp = /^TypeError: size must be a number >= 0$/;
206
207
} , / s i z e m u s t b e a u i n t 3 2 / ) ;
207
208
208
209
assert . throws ( ( ) => {
209
- crypto . randomFill ( buf , 0 , - 10 , common . noop ) ;
210
+ crypto . randomFill ( buf , 0 , - 10 , common . mustNotCall ( ) ) ;
210
211
} , / s i z e m u s t b e a u i n t 3 2 / ) ;
211
212
212
213
assert . throws ( ( ) => {
213
- crypto . randomFill ( buf , 0 , size , common . noop ) ;
214
+ crypto . randomFill ( buf , 0 , size , common . mustNotCall ( ) ) ;
214
215
} , / s i z e m u s t b e a u i n t 3 2 / ) ;
215
216
}
216
217
@@ -219,23 +220,23 @@ const expectedErrorRegexp = /^TypeError: size must be a number >= 0$/;
219
220
} , / o f f s e t m u s t b e a u i n t 3 2 / ) ;
220
221
221
222
assert . throws ( ( ) => {
222
- crypto . randomFill ( buf , - 10 , common . noop ) ;
223
+ crypto . randomFill ( buf , - 10 , common . mustNotCall ( ) ) ;
223
224
} , / o f f s e t m u s t b e a u i n t 3 2 / ) ;
224
225
225
226
assert . throws ( ( ) => {
226
227
crypto . randomFillSync ( buf , 1 , 10 ) ;
227
228
} , / b u f f e r t o o s m a l l / ) ;
228
229
229
230
assert . throws ( ( ) => {
230
- crypto . randomFill ( buf , 1 , 10 , common . noop ) ;
231
+ crypto . randomFill ( buf , 1 , 10 , common . mustNotCall ( ) ) ;
231
232
} , / b u f f e r t o o s m a l l / ) ;
232
233
233
234
assert . throws ( ( ) => {
234
235
crypto . randomFillSync ( buf , 0 , 12 ) ;
235
236
} , / b u f f e r t o o s m a l l / ) ;
236
237
237
238
assert . throws ( ( ) => {
238
- crypto . randomFill ( buf , 0 , 12 , common . noop ) ;
239
+ crypto . randomFill ( buf , 0 , 12 , common . mustNotCall ( ) ) ;
239
240
} , / b u f f e r t o o s m a l l / ) ;
240
241
241
242
{
@@ -246,7 +247,7 @@ const expectedErrorRegexp = /^TypeError: size must be a number >= 0$/;
246
247
} , / o f f s e t m u s t b e a u i n t 3 2 / ) ;
247
248
248
249
assert . throws ( ( ) => {
249
- crypto . randomFill ( buf , offset , 10 , common . noop ) ;
250
+ crypto . randomFill ( buf , offset , 10 , common . mustNotCall ( ) ) ;
250
251
} , / o f f s e t m u s t b e a u i n t 3 2 / ) ;
251
252
}
252
253
}
0 commit comments