Skip to content

Commit 99fcab5

Browse files
committed
Add value sanity checks
1 parent 2c46a67 commit 99fcab5

File tree

1 file changed

+2
-2
lines changed
  • lib/node_modules/@stdlib/ndarray/ctor/benchmark/c

1 file changed

+2
-2
lines changed

lib/node_modules/@stdlib/ndarray/ctor/benchmark/c/benchmark.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -647,14 +647,14 @@ double benchmark13() {
647647
for ( i = 0; i < ITERATIONS; i++ ) {
648648
sub[ 0 ] = (int64_t)( (rand_double()*20.0)-10.0 );
649649
v = stdlib_ndarray_get_ptr( arr, sub );
650-
if ( v == NULL ) {
650+
if ( v == NULL || *(uint8_t *)v > 6 ) {
651651
printf( "unexpected result\n" );
652652
break;
653653
}
654654
}
655655
elapsed = tic() - t;
656656

657-
if ( v == NULL ) {
657+
if ( v == NULL || *(uint8_t *)v > 6 ) {
658658
printf( "unexpected result\n" );
659659
}
660660
free( arr );

0 commit comments

Comments
 (0)