diff options
author | Paul Yang <TeBoring@users.noreply.github.com> | 2017-09-12 15:09:47 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-09-12 15:09:47 -0700 |
commit | 2bd55a9fbcd2815b3332bf309bc20f59eef0b36b (patch) | |
tree | 049577e28c1ee1b2f29fc71c22d06ec6016cae45 /js/compatibility_tests | |
parent | 6a4ffb2f90ef7bbd3f20f2a1db4948630ad37dc8 (diff) | |
download | protobuf-2bd55a9fbcd2815b3332bf309bc20f59eef0b36b.tar.gz protobuf-2bd55a9fbcd2815b3332bf309bc20f59eef0b36b.tar.bz2 protobuf-2bd55a9fbcd2815b3332bf309bc20f59eef0b36b.zip |
Fix js conformance tests. (#3604)
* Fix js conformance tests.
* Remove old incorrect compatibility tests
Diffstat (limited to 'js/compatibility_tests')
-rw-r--r-- | js/compatibility_tests/v3.0.0/binary/decoder_test.js | 19 | ||||
-rw-r--r-- | js/compatibility_tests/v3.1.0/binary/decoder_test.js | 19 |
2 files changed, 2 insertions, 36 deletions
diff --git a/js/compatibility_tests/v3.0.0/binary/decoder_test.js b/js/compatibility_tests/v3.0.0/binary/decoder_test.js index ac312648..fce2fe18 100644 --- a/js/compatibility_tests/v3.0.0/binary/decoder_test.js +++ b/js/compatibility_tests/v3.0.0/binary/decoder_test.js @@ -228,24 +228,7 @@ describe('binaryDecoderTest', function() { assertThrows(function() {decoder.readSignedVarint64()}); decoder.reset(); assertThrows(function() {decoder.readZigzagVarint64()}); - - // Positive 32-bit varints encoded with 1 bits in positions 33 through 35 - // should trigger assertions. - decoder.setBlock([255, 255, 255, 255, 0x1F]); - assertThrows(function() {decoder.readUnsignedVarint32()}); - - decoder.setBlock([255, 255, 255, 255, 0x2F]); - assertThrows(function() {decoder.readUnsignedVarint32()}); - - decoder.setBlock([255, 255, 255, 255, 0x4F]); - assertThrows(function() {decoder.readUnsignedVarint32()}); - - // Negative 32-bit varints encoded with non-1 bits in the high dword should - // trigger assertions. - decoder.setBlock([255, 255, 255, 255, 255, 255, 0, 255, 255, 1]); - assertThrows(function() {decoder.readUnsignedVarint32()}); - - decoder.setBlock([255, 255, 255, 255, 255, 255, 255, 255, 255, 0]); + decoder.reset(); assertThrows(function() {decoder.readUnsignedVarint32()}); }); diff --git a/js/compatibility_tests/v3.1.0/binary/decoder_test.js b/js/compatibility_tests/v3.1.0/binary/decoder_test.js index ac312648..fce2fe18 100644 --- a/js/compatibility_tests/v3.1.0/binary/decoder_test.js +++ b/js/compatibility_tests/v3.1.0/binary/decoder_test.js @@ -228,24 +228,7 @@ describe('binaryDecoderTest', function() { assertThrows(function() {decoder.readSignedVarint64()}); decoder.reset(); assertThrows(function() {decoder.readZigzagVarint64()}); - - // Positive 32-bit varints encoded with 1 bits in positions 33 through 35 - // should trigger assertions. - decoder.setBlock([255, 255, 255, 255, 0x1F]); - assertThrows(function() {decoder.readUnsignedVarint32()}); - - decoder.setBlock([255, 255, 255, 255, 0x2F]); - assertThrows(function() {decoder.readUnsignedVarint32()}); - - decoder.setBlock([255, 255, 255, 255, 0x4F]); - assertThrows(function() {decoder.readUnsignedVarint32()}); - - // Negative 32-bit varints encoded with non-1 bits in the high dword should - // trigger assertions. - decoder.setBlock([255, 255, 255, 255, 255, 255, 0, 255, 255, 1]); - assertThrows(function() {decoder.readUnsignedVarint32()}); - - decoder.setBlock([255, 255, 255, 255, 255, 255, 255, 255, 255, 0]); + decoder.reset(); assertThrows(function() {decoder.readUnsignedVarint32()}); }); |