Skip to content

Commit

Permalink
test: remove semis
Browse files Browse the repository at this point in the history
  • Loading branch information
TooTallNate committed May 19, 2014
1 parent e6e8278 commit 1998583
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions test/callback.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,24 +27,24 @@ describe('Callback', function () {
})

it('should not call "set()" of a pointer type', function () {
var voidType = Object.create(ref.types.void);
var voidType = Object.create(ref.types.void)
voidType.get = function () {
throw new Error('"get()" should not be called');
throw new Error('"get()" should not be called')
}
voidType.set = function () {
throw new Error('"set()" should not be called');
throw new Error('"set()" should not be called')
}
var voidPtr = ref.refType(voidType)
var called = false
var cb = ffi.Callback(voidPtr, [ voidPtr ], function (ptr) {
called = true
assert.equal(0, ptr.address());
assert.equal(0, ptr.address())
return ptr
});
})

var fn = ffi.ForeignFunction(cb, voidPtr, [ voidPtr ]);
var fn = ffi.ForeignFunction(cb, voidPtr, [ voidPtr ])
assert(!called)
var nul = fn(ref.NULL);
var nul = fn(ref.NULL)
assert(called)
assert(Buffer.isBuffer(nul))
assert.equal(0, nul.address())
Expand Down

0 comments on commit 1998583

Please sign in to comment.