@@ -167,8 +167,8 @@ public function testBitsets() {
167
167
// Verify valid offset ranges
168
168
$ this ->assertFalse ($ this ->redis ->getBit ('key ' , -1 ));
169
169
170
- $ this ->redis ->setBit ('key ' , 4294967295 , 1 );
171
- $ this ->assertEquals (1 , $ this ->redis ->getBit ('key ' , 4294967295 ));
170
+ $ this ->redis ->setBit ('key ' , 0x7fffffff , 1 );
171
+ $ this ->assertEquals (1 , $ this ->redis ->getBit ('key ' , 0x7fffffff ));
172
172
}
173
173
174
174
public function testBitPos () {
@@ -476,6 +476,9 @@ public function testSetNX() {
476
476
}
477
477
478
478
public function testExpireAtWithLong () {
479
+ if (PHP_INT_SIZE != 8 ) {
480
+ $ this ->markTestSkipped ('64 bits only ' );
481
+ }
479
482
$ longExpiryTimeExceedingInt = 3153600000 ;
480
483
$ this ->redis ->del ('key ' );
481
484
$ this ->assertTrue ($ this ->redis ->setex ('key ' , $ longExpiryTimeExceedingInt , 'val ' ) === TRUE );
@@ -515,7 +518,7 @@ public function testIncr()
515
518
$ this ->assertTrue ("abc " === $ this ->redis ->get ('key ' ));
516
519
517
520
$ this ->redis ->set ('key ' , 0 );
518
- $ this ->assertEquals (2147483648 , $ this ->redis ->incrby ('key ' , 2147483648 ));
521
+ $ this ->assertEquals (PHP_INT_MAX , $ this ->redis ->incrby ('key ' , PHP_INT_MAX ));
519
522
}
520
523
521
524
public function testIncrByFloat ()
@@ -550,7 +553,7 @@ public function testIncrByFloat()
550
553
$ this ->redis ->setOption (Redis::OPT_PREFIX , 'someprefix: ' );
551
554
$ this ->redis ->del ('key ' );
552
555
$ this ->redis ->incrbyfloat ('key ' ,1.8 );
553
- $ this ->assertEquals (' 1.8 ' , $ this ->redis ->get ('key ' ));
556
+ $ this ->assertEquals (1.8 , floatval ( $ this ->redis ->get ('key ' ))); // convert to float to avoid rounding issue on arm
554
557
$ this ->redis ->setOption (Redis::OPT_PREFIX , '' );
555
558
$ this ->assertTrue ($ this ->redis ->exists ('someprefix:key ' ));
556
559
$ this ->redis ->del ('someprefix:key ' );
@@ -2296,8 +2299,8 @@ public function testHashes() {
2296
2299
$ this ->assertTrue (3 === $ this ->redis ->hIncrBy ('h ' , 'x ' , 1 ));
2297
2300
$ this ->assertTrue (2 === $ this ->redis ->hIncrBy ('h ' , 'x ' , -1 ));
2298
2301
$ this ->assertTrue ("2 " === $ this ->redis ->hGet ('h ' , 'x ' ));
2299
- $ this ->assertTrue (1000000000002 === $ this ->redis ->hIncrBy ('h ' , 'x ' , 1000000000000 ));
2300
- $ this ->assertTrue ("1000000000002 " === $ this ->redis ->hGet ('h ' , 'x ' ));
2302
+ $ this ->assertTrue (PHP_INT_MAX === $ this ->redis ->hIncrBy ('h ' , 'x ' , PHP_INT_MAX - 2 ));
2303
+ $ this ->assertTrue ("" . PHP_INT_MAX === $ this ->redis ->hGet ('h ' , 'x ' ));
2301
2304
2302
2305
$ this ->redis ->hSet ('h ' , 'y ' , 'not-a-number ' );
2303
2306
$ this ->assertTrue (FALSE === $ this ->redis ->hIncrBy ('h ' , 'y ' , 1 ));
0 commit comments