Repository: qpid-interop-test Updated Branches: refs/heads/master 156ac5a56 -> 97cad30c7
QPIDIT-47: Patch accepted into upstream Rhea. Removed patch file and text in README concerning the patch. Project: http://git-wip-us.apache.org/repos/asf/qpid-interop-test/repo Commit: http://git-wip-us.apache.org/repos/asf/qpid-interop-test/commit/97cad30c Tree: http://git-wip-us.apache.org/repos/asf/qpid-interop-test/tree/97cad30c Diff: http://git-wip-us.apache.org/repos/asf/qpid-interop-test/diff/97cad30c Branch: refs/heads/master Commit: 97cad30c7706b1a92fa25575000eb80f4a51eec8 Parents: 156ac5a Author: Kim van der Riet <[email protected]> Authored: Fri Nov 11 13:49:49 2016 -0500 Committer: Kim van der Riet <[email protected]> Committed: Fri Nov 11 13:49:49 2016 -0500 ---------------------------------------------------------------------- shims/rhea-js/amqp_types_test/README | 12 ----- .../amqp_types_test/rhea-long-ulong.patch | 50 -------------------- 2 files changed, 62 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/qpid-interop-test/blob/97cad30c/shims/rhea-js/amqp_types_test/README ---------------------------------------------------------------------- diff --git a/shims/rhea-js/amqp_types_test/README b/shims/rhea-js/amqp_types_test/README index 308a141..feb8f79 100644 --- a/shims/rhea-js/amqp_types_test/README +++ b/shims/rhea-js/amqp_types_test/README @@ -33,15 +33,3 @@ Required modules rhea (https://github.com/grs/rhea.git) node-uuid (via npm) -NOTE: For the tests to pass, a patch is needed for the Rhea javascript client. -This patch is contained in the file rhea-long-ulong.patch. It addresses a -problem in Javascript in which numbers are represented internally as floating -point numbers. This means that the precision available for representing large -integer values is limited, and can round up or down to a representation that -is not exact and can cause tests to fail. (For example, the unsigned long -number 0x7fffffffffffffff will round to 0x8000000000000000). The patch allows -numbers stored in Buffer objects to be used to set a long or ulong values in -message bodies, which avoids this problem. If the patch is not applied, the -long and ulong tests will fail. (If this patch is accepted into Rhea, then -this file will be removed.) - http://git-wip-us.apache.org/repos/asf/qpid-interop-test/blob/97cad30c/shims/rhea-js/amqp_types_test/rhea-long-ulong.patch ---------------------------------------------------------------------- diff --git a/shims/rhea-js/amqp_types_test/rhea-long-ulong.patch b/shims/rhea-js/amqp_types_test/rhea-long-ulong.patch deleted file mode 100644 index c7497c3..0000000 --- a/shims/rhea-js/amqp_types_test/rhea-long-ulong.patch +++ /dev/null @@ -1,50 +0,0 @@ -diff --git lib/types.js lib/types.js -index 985607f..f1d5514 100644 ---- lib/types.js -+++ lib/types.js -@@ -270,6 +270,12 @@ function is_one_of(o, typelist) { - } - return false; - } -+function buffer_zero(b, len, neg) { -+ for (var i = 0; i < len && i < b.length; i++) { -+ if (b[i] !== (neg ? 0xff : 0)) return false; -+ } -+ return true; -+} - types.is_ulong = function(o) { - return is_one_of(o, [types.Ulong, types.Ulong0, types.SmallUlong]); - }; -@@ -290,8 +296,13 @@ types.wrap_boolean = function(v) { - return v ? new types.True() : new types.False(); - }; - types.wrap_ulong = function(l) { -- if (l === 0) return new types.Ulong0(); -- else return l > 255 ? new types.Ulong(l) : new types.SmallUlong(l); -+ if (Buffer.isBuffer(l)) { -+ if (buffer_zero(l, 8, false)) return new types.Ulong0(); -+ return buffer_zero(l, 7, false) ? new types.SmallUlong(l[7]) : new types.Ulong(l); -+ } else { -+ if (l === 0) return new types.Ulong0(); -+ else return l > 255 ? new types.Ulong(l) : new types.SmallUlong(l); -+ } - }; - types.wrap_uint = function(l) { - if (l === 0) return new types.Uint0(); -@@ -304,7 +315,15 @@ types.wrap_ubyte = function(l) { - return new types.Ubyte(l); - }; - types.wrap_long = function(l) { -- return l > 127 || l < -128 ? new types.Long(l) : new types.SmallLong(l); -+ if (Buffer.isBuffer(l)) { -+ var negFlag = (l[0] & 0x80) !== 0; -+ if (buffer_zero(l, 7, negFlag) && (l[7] & 0x80) === (negFlag ? 0x80 : 0)) { -+ return new types.SmallLong(negFlag ? -((l[7] ^ 0xff) + 1) : l[7]); -+ } -+ return new types.Long(l); -+ } else { -+ return l > 127 || l < -128 ? new types.Long(l) : new types.SmallLong(l); -+ } - }; - types.wrap_int = function(l) { - return l > 127 || l < -128 ? new types.Int(l) : new types.SmallInt(l); --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
