aboutsummaryrefslogtreecommitdiff
path: root/js/compatibility_tests
diff options
context:
space:
mode:
authorJisi Liu <jisi.liu@gmail.com>2017-10-18 12:22:18 -0700
committerJisi Liu <jisi.liu@gmail.com>2017-10-18 12:22:18 -0700
commit1a7a7fca804afa1cf67f8be5e71092898ba40334 (patch)
tree04b3da27c71c607510f34a12cf7856a1b94181ae /js/compatibility_tests
parentc4f59dcc5c13debc572154c8f636b8a9361aacde (diff)
downloadprotobuf-1a7a7fca804afa1cf67f8be5e71092898ba40334.tar.gz
protobuf-1a7a7fca804afa1cf67f8be5e71092898ba40334.tar.bz2
protobuf-1a7a7fca804afa1cf67f8be5e71092898ba40334.zip
Merge from google internal
Diffstat (limited to 'js/compatibility_tests')
-rw-r--r--js/compatibility_tests/v3.0.0/binary/decoder_test.js19
-rw-r--r--js/compatibility_tests/v3.1.0/binary/decoder_test.js19
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()});
});