Skip to content

Commit

Permalink
fix(longs): temporarily fix encoding longs in master
Browse files Browse the repository at this point in the history
  • Loading branch information
mbroadst committed Feb 16, 2016
1 parent 1c3fe4e commit c9e4810
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 15 deletions.
4 changes: 2 additions & 2 deletions lib/types.js
Expand Up @@ -386,7 +386,7 @@ registerType('ulong', {
bufb.appendUInt32BE(0x0);
bufb.appendUInt32BE(val);
} else {
throw new errors.NotImplementedError('No int64 Number supported by buffer encoder');
bufb.appendBuffer((new Int64(val)).toBuffer());
}
}
},
Expand Down Expand Up @@ -433,7 +433,7 @@ registerType('long', {
bufb.appendUInt32BE(val < 0 ? 0xFFFFFFFF : 0x0);
bufb.appendUInt32BE(val < 0 ? (0xFFFFFFFF - absval + 1) : absval);
} else {
throw new errors.NotImplementedError('buffer-encoder does not support 64-bit int appending');
bufb.appendBuffer((new Int64(val)).toBuffer());
}
} else {
throw new errors.EncodingError('Invalid encoding type for 64-bit value: ' + val);
Expand Down
2 changes: 1 addition & 1 deletion package.json
@@ -1,6 +1,6 @@
{
"name": "amqp10",
"version": "2.2.2",
"version": "2.2.4",
"description": "Native AMQP-1.0 client for node.js",
"main": "./lib",
"engines": {
Expand Down
4 changes: 2 additions & 2 deletions test/integration/servicebus/eventhubs/client.test.js
Expand Up @@ -29,8 +29,8 @@ describe('ServiceBus', function() {
test.client.connect(config.address)
.then(function() {
return Promise.all(
_.range(config.partitionCount).map(function(partition) { return test.client.createReceiver(config.receiverLinkPrefix + partition); }).
concat(test.client.createSender(config.senderLink))
_.range(config.partitionCount).map(function(partition) { return test.client.createReceiver(config.receiverLinkPrefix + partition); }).
concat(test.client.createSender(config.senderLink))
);
})
.then(function (links) {
Expand Down
20 changes: 10 additions & 10 deletions test/unit/test_types.js
Expand Up @@ -47,11 +47,11 @@ describe('Types', function() {
describe('primitives', function() {
describe('scalar', function() {
describe('errors', function() {
it('should error encoding ulongs greater than 2^32 - 1', function() {
var buffer = new BufferBuilder();
var type = new ForcedType('ulong', 4294967295);
expect(function() { codec.encode(type, buffer); }).to.throw(errors.NotImplementedError);
});
// it('should error encoding ulongs greater than 2^32 - 1', function() {
// var buffer = new BufferBuilder();
// var type = new ForcedType('ulong', 4294967295);
// expect(function() { codec.encode(type, buffer); }).to.throw(errors.NotImplementedError);
// });

it('should error encoding ulongs of invalid type', function() {
var buffer = new BufferBuilder();
Expand All @@ -60,11 +60,11 @@ describe('Types', function() {
});


it('should error encoding longs greater than 2^32 - 1', function() {
var buffer = new BufferBuilder();
var type = new ForcedType('long', 4294967295);
expect(function() { codec.encode(type, buffer); }).to.throw(errors.NotImplementedError);
});
// it('should error encoding longs greater than 2^32 - 1', function() {
// var buffer = new BufferBuilder();
// var type = new ForcedType('long', 4294967295);
// expect(function() { codec.encode(type, buffer); }).to.throw(errors.NotImplementedError);
// });

it('should error encoding longs of invalid type', function() {
var buffer = new BufferBuilder();
Expand Down

0 comments on commit c9e4810

Please sign in to comment.