Permalink
Browse files

disabled wip tests

  • Loading branch information...
1 parent d5e45a1 commit 195b09c3ac813aa941f2ba591369aad86894a6eb @sidorares committed Dec 30, 2012
Showing with 23 additions and 16 deletions.
  1. +4 −4 test/signature.js
  2. +11 −5 test/unmarshall-basic.js
  3. +2 −3 test/unmarshall-message.js
  4. +6 −4 test/unmarshall1.js
View
@@ -8,9 +8,9 @@ describe('Signature parser', function() {
afterEach(function(done) {
});
- it('parses simple sequence', function(done) {
- var res = parse('yvsgu');
- // TODO: wip
- });
+ //it('parses simple sequence', function(done) {
+ // var res = parse('yvsgu');
+ // // TODO: wip
+ //});
});
View
@@ -9,7 +9,7 @@ function testOnly() {};
function test(signature, data, callback) {
console.log(signature, data);
var marshalledBuffer = marshall(signature, data);
- //console.error(hexy(marshalledBuffer, {prefix: '===='}));
+ console.error(hexy(marshalledBuffer, {prefix: '===='}));
var stream = binary(marshalledBuffer);
unmarshall.call(stream, signature, 0, function(err, result) {
if (err)
@@ -66,6 +66,16 @@ describe('marshall/unmarshall', function() {
['yyy(yyy)y', [5, 6, 7, [1, 2, 3], 4]],
['yyyy(yyy)y', [5, 6, 7, 8, [1, 2, 3], 4]],
['yyyyy(yyy)y', [5, 6, 7, 8, 9, [1, 2, 3], 4]]
+ ],
+ 'arrays of simple types': [
+ ['ai', [[1, 2, 3, 4, 5, 6, 7]]],
+ ['aai', [[[300, 400, 500], [1, 2, 3, 4, 5, 6, 7]]] ],
+ ['aiai', [[1, 2, 3], [300, 400, 500]] ],
+ ],
+ 'compound types': [
+ ['iyai', [10, 100, [1, 2, 3, 4, 5, 6]]],
+ // TODO: fix 'array of structs offset problem
+ //['a(iyai)', [[[10, 100, [1, 2, 3, 4, 5, 6]], [11, 200, [15, 4, 5, 6]]]] ]
]
};
@@ -111,9 +121,6 @@ for (var t1 = 0; t1 < intTypes.length; ++t1)
test('ai', [[]]);
test('aai', [[[]]]);
-test('ai', [[1, 2, 3, 4, 5, 6, 7]]);
-test('aiay', [[300, 400, 500], [1, 2, 3, 4, 5, 6, 7]]);
-testOnly('ayai', [[1, 2, 3], [300, 400, 500]]);
@@ -129,6 +136,5 @@ testOnly('ayai', [[1, 2, 3], [300, 400, 500]]);
// np test('a(ai)', [[ [[1, 2, 3, 4, 5, 6]], [[15, 4, 5, 6]] ]]);
// pass test('aai', [[[1, 2, 3, 4, 5, 6], [15, 4, 5, 6]]]);
-// pass test('iyai', [10, 100, [1, 2, 3, 4, 5, 6]]);
*/
@@ -5,6 +5,7 @@ var binary = require('binary');
var buffers = require('buffers');
var assert = require('assert');
var hexy = require('../lib/hexy').hexy;
+var common = require('./common');
function msg2buff(msg) {
var buff = buffers();
@@ -32,6 +33,7 @@ function buff2msg(buff, callback) {
}
var msg1 = {
+ type: 1,
destination: "final",
flags: 1,
signature: "uuu",
@@ -40,13 +42,10 @@ var msg1 = {
function test(msg) {
var messageBuff = msg2buff(msg);
- //console.error(hexy(messageBuff, {prefix: 'message '}));
buff2msg(messageBuff, function(msgout) {
- //console.log(msg);
assert.deepEqual(msg, msgout);
});
}
-
test(msg1);
//test({signature: 'ai', body: [[]]});
View
@@ -6,7 +6,9 @@ var common = require('./common');
var data = require('fs').readFileSync(common.fixturesDir + '/problembody.bin');
var bufstream = require('binary').parse(data);
-unmarshall.call(bufstream, signature, 0, function(err, result) {
- console.log(result);
- console.error(hexy(data, {prefix: '===='}));
-});
+// TODO: mochify, re-enable after array of structs offset fixed
+
+//unmarshall.call(bufstream, signature, 0, function(err, result) {
+// console.log(result);
+// console.error(hexy(data, {prefix: '===='}));
+//});

0 comments on commit 195b09c

Please sign in to comment.