1
0
Fork 0
mirror of https://github.com/DanielnetoDotCom/YouPHPTube synced 2025-10-04 02:09:22 +02:00
Also check the lang in case insensitive
This commit is contained in:
Daniel 2022-03-14 14:28:38 -03:00
parent 33e7f7384e
commit 2a9630258f
22658 changed files with 3562773 additions and 3562767 deletions

View file

@ -1,32 +1,32 @@
var
QUnit = require('qunit'),
toUnsigned = require('../lib/utils/bin').toUnsigned;
QUnit.module('Binary Utils');
QUnit.test('converts values to unsigned integers after bitwise operations', function(assert) {
var bytes;
bytes = [0, 0, 124, 129];
assert.equal(toUnsigned(bytes[0] << 24 |
bytes[1] << 16 |
bytes[2] << 8 |
bytes[3]),
31873, 'positive signed result stays positive');
bytes = [150, 234, 221, 192];
// sanity check
assert.equal(bytes[0] << 24 |
bytes[1] << 16 |
bytes[2] << 8 |
bytes[3],
-1762992704, 'bitwise operation produces negative signed result');
assert.equal(toUnsigned(bytes[0] << 24 |
bytes[1] << 16 |
bytes[2] << 8 |
bytes[3]),
2531974592, 'negative signed result becomes unsigned positive');
});
var
QUnit = require('qunit'),
toUnsigned = require('../lib/utils/bin').toUnsigned;
QUnit.module('Binary Utils');
QUnit.test('converts values to unsigned integers after bitwise operations', function(assert) {
var bytes;
bytes = [0, 0, 124, 129];
assert.equal(toUnsigned(bytes[0] << 24 |
bytes[1] << 16 |
bytes[2] << 8 |
bytes[3]),
31873, 'positive signed result stays positive');
bytes = [150, 234, 221, 192];
// sanity check
assert.equal(bytes[0] << 24 |
bytes[1] << 16 |
bytes[2] << 8 |
bytes[3],
-1762992704, 'bitwise operation produces negative signed result');
assert.equal(toUnsigned(bytes[0] << 24 |
bytes[1] << 16 |
bytes[2] << 8 |
bytes[3]),
2531974592, 'negative signed result becomes unsigned positive');
});