diff options
author | Adam Cozzette <acozzette@google.com> | 2016-06-29 15:23:27 -0700 |
---|---|---|
committer | Adam Cozzette <acozzette@google.com> | 2016-06-29 15:38:03 -0700 |
commit | d64a2d9941c36a7bc2a7959ea10ab8363192ac14 (patch) | |
tree | 52330d146ad63d3d70f3baade00d5d1fea8f5e0c /js/binary/reader_test.js | |
parent | c18aa7795a2e02ef700ff8b039d94ecdcc33432f (diff) | |
download | protobuf-d64a2d9941c36a7bc2a7959ea10ab8363192ac14.tar.gz protobuf-d64a2d9941c36a7bc2a7959ea10ab8363192ac14.tar.bz2 protobuf-d64a2d9941c36a7bc2a7959ea10ab8363192ac14.zip |
Integrated internal changes from Google
This includes all internal changes from around May 20 to now.
Diffstat (limited to 'js/binary/reader_test.js')
-rw-r--r-- | js/binary/reader_test.js | 25 |
1 files changed, 11 insertions, 14 deletions
diff --git a/js/binary/reader_test.js b/js/binary/reader_test.js index db674cf8..95711385 100644 --- a/js/binary/reader_test.js +++ b/js/binary/reader_test.js @@ -52,9 +52,8 @@ goog.require('jspb.BinaryWriter'); describe('binaryReaderTest', function() { /** * Tests the reader instance cache. - * @suppress {visibility} */ - it('testInstanceCaches', function() { + it('testInstanceCaches', /** @suppress {visibility} */ function() { var writer = new jspb.BinaryWriter(); var dummyMessage = /** @type {!jspb.BinaryMessage} */({}); writer.writeMessage(1, dummyMessage, goog.nullFunction); @@ -131,9 +130,8 @@ describe('binaryReaderTest', function() { /** * Verifies that misuse of the reader class triggers assertions. - * @suppress {checkTypes|visibility} */ - it('testReadErrors', function() { + it('testReadErrors', /** @suppress {checkTypes|visibility} */ function() { // Calling readMessage on a non-delimited field should trigger an // assertion. var reader = jspb.BinaryReader.alloc([8, 1]); @@ -200,7 +198,7 @@ describe('binaryReaderTest', function() { * @private * @suppress {missingProperties} */ - function doTestUnsignedField_(readField, + var doTestUnsignedField_ = function(readField, writeField, epsilon, upperLimit, filter) { assertNotNull(readField); assertNotNull(writeField); @@ -252,7 +250,7 @@ describe('binaryReaderTest', function() { * @private * @suppress {missingProperties} */ - function doTestSignedField_(readField, + var doTestSignedField_ = function(readField, writeField, epsilon, lowerLimit, upperLimit, filter) { var writer = new jspb.BinaryWriter(); @@ -321,12 +319,12 @@ describe('binaryReaderTest', function() { * Tests fields that use varint encoding. */ it('testVarintFields', function() { - assertNotNull(jspb.BinaryReader.prototype.readUint32); - assertNotNull(jspb.BinaryReader.prototype.writeUint32); - assertNotNull(jspb.BinaryReader.prototype.readUint64); - assertNotNull(jspb.BinaryReader.prototype.writeUint64); - assertNotNull(jspb.BinaryReader.prototype.readBool); - assertNotNull(jspb.BinaryReader.prototype.writeBool); + assertNotUndefined(jspb.BinaryReader.prototype.readUint32); + assertNotUndefined(jspb.BinaryWriter.prototype.writeUint32); + assertNotUndefined(jspb.BinaryReader.prototype.readUint64); + assertNotUndefined(jspb.BinaryWriter.prototype.writeUint64); + assertNotUndefined(jspb.BinaryReader.prototype.readBool); + assertNotUndefined(jspb.BinaryWriter.prototype.writeBool); doTestUnsignedField_( jspb.BinaryReader.prototype.readUint32, jspb.BinaryWriter.prototype.writeUint32, @@ -369,8 +367,7 @@ describe('binaryReaderTest', function() { var bytesCount = (hexString.length + 1) / 3; var bytes = new Uint8Array(bytesCount); for (var i = 0; i < bytesCount; i++) { - byte = parseInt(hexString.substring(i * 3, i * 3 + 2), 16); - bytes[i] = byte; + bytes[i] = parseInt(hexString.substring(i * 3, i * 3 + 2), 16); } var reader = jspb.BinaryReader.alloc(bytes); reader.nextField(); |