diff --git a/test/cpp/bufferworkerpersistent.cpp b/test/cpp/bufferworkerpersistent.cpp index 91693bc8..4a85fe50 100644 --- a/test/cpp/bufferworkerpersistent.cpp +++ b/test/cpp/bufferworkerpersistent.cpp @@ -23,7 +23,10 @@ class BufferWorker : public NanAsyncWorker { NanScope(); + /* test them all */ SaveToPersistent("buffer", bufferHandle); + SaveToPersistent(NanNew("puffer"), bufferHandle); + SaveToPersistent(0u, bufferHandle); } ~BufferWorker() {} @@ -37,6 +40,12 @@ class BufferWorker : public NanAsyncWorker { v8::Local handle = GetFromPersistent("buffer"); callback->Call(1, &handle); + + handle = GetFromPersistent(NanNew("puffer")); + callback->Call(1, &handle); + + handle = GetFromPersistent(0u); + callback->Call(1, &handle); } private: diff --git a/test/js/bufferworkerpersistent-test.js b/test/js/bufferworkerpersistent-test.js index 2cc4ed86..e771aae6 100644 --- a/test/js/bufferworkerpersistent-test.js +++ b/test/js/bufferworkerpersistent-test.js @@ -13,19 +13,15 @@ const test = require('tap').test test('bufferworkerpersistent', function (t) { var worker = bindings.a - , called = false + , called = 0 , buf = crypto.randomBytes(256) , bufHex = buf.toString('hex') - t.type(worker, 'function') + t.plan(7); - setTimeout(function () { - t.ok(called, 'callback fired') - t.end() - }, 500) + t.type(worker, 'function') worker(200, buf, function (_buf) { - called = true t.ok(Buffer.isBuffer(_buf), 'is buffer arg') t.equal(_buf.toString('hex'), bufHex) })