Skip to content

Commit 4104f40

Browse files
authored
Merge pull request #319 from remicollet/issue-tests
ensure tests are ok for 32bits build
2 parents 8a40f2c + f8fd622 commit 4104f40

File tree

3 files changed

+8
-8
lines changed

3 files changed

+8
-8
lines changed

tests/gh_90.phpt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ $memcached = memc_get_instance (array (
1212
// Create a key for use as a lock. If this key already exists, wait till it doesn't exist.
1313
{
1414
$key = 'LockKey';
15-
$lockToken = mt_rand(0, pow(2, 32)); //Random value betwen 0 and 2^32 for ownership verification
15+
$lockToken = mt_rand(0, mt_getrandmax()); //Random value for ownership verification
1616

1717
while (true)
1818
{
@@ -88,4 +88,4 @@ array(10) {
8888
int(1)
8989
["9_%s"]=>
9090
int(1)
91-
}
91+
}

tests/incrdecr.phpt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -42,10 +42,10 @@ echo $php_errormsg, "\n";
4242
var_dump($m->get('foo'));
4343

4444
echo "Enormous offset\n";
45-
$m->increment('foo', 4294967296);
45+
$m->increment('foo', 0x7f000000);
4646
var_dump($m->get('foo'));
4747

48-
$m->decrement('foo', 4294967296);
48+
$m->decrement('foo', 0x7f000000);
4949
var_dump($m->get('foo'));
5050

5151
--EXPECT--
@@ -68,5 +68,5 @@ int(1)
6868
Memcached::decrement(): offset cannot be a negative value
6969
int(1)
7070
Enormous offset
71-
int(4294967297)
71+
int(2130706433)
7272
int(1)

tests/incrdecr_bykey.phpt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -39,10 +39,10 @@ echo $php_errormsg, "\n";
3939
var_dump($m->get('foo'));
4040

4141
echo "Enormous offset\n";
42-
$m->incrementByKey('foo', 'foo', 4294967296);
42+
$m->incrementByKey('foo', 'foo', 0x7f000000);
4343
var_dump($m->get('foo'));
4444

45-
$m->decrementByKey('foo', 'foo', 4294967296);
45+
$m->decrementByKey('foo', 'foo', 0x7f000000);
4646
var_dump($m->get('foo'));
4747

4848
--EXPECT--
@@ -62,5 +62,5 @@ int(1)
6262
Memcached::decrementByKey(): offset cannot be a negative value
6363
int(1)
6464
Enormous offset
65-
int(4294967297)
65+
int(2130706433)
6666
int(1)

0 commit comments

Comments
 (0)