Skip to content

Commit

Permalink
Merge pull request IntelRealSense#2136 from zhaoming0/fix-DSO-10094
Browse files Browse the repository at this point in the history
[nodejs] update test-depthframe.js and test-videoframe.js
  • Loading branch information
tingshao authored Aug 14, 2018
2 parents c540e3b + dcd925b commit 991ed5c
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 12 deletions.
18 changes: 12 additions & 6 deletions wrappers/nodejs/test/test-depthframe.js
Original file line number Diff line number Diff line change
Expand Up @@ -105,12 +105,18 @@ describe('DepthFrame test', function() {
i.toUpperCase() !== 'FRAME_METADATA_COUNT' && // skip counter
i !== 'frameMetadataToString' // skip method
) {
assert.doesNotThrow(() => { // jshint ignore:line
frame.frameMetadata(rs2.frame_metadata[i]);
});
assert.equal(Object.prototype.toString.call(
frame.frameMetadata(rs2.frame_metadata[i])
), '[object Uint8Array]');
if (frame.supportsFrameMetadata(rs2.frame_metadata[i])) {
assert.doesNotThrow(() => { // jshint ignore:line
frame.frameMetadata(rs2.frame_metadata[i]);
});
assert.equal(Object.prototype.toString.call(
frame.frameMetadata(rs2.frame_metadata[i])
), '[object Uint8Array]');
} else {
assert.throws(() => { // jshint ignore:line
frame.frameMetadata(rs2.frame_metadata[i]);
});
}
}
}
});
Expand Down
18 changes: 12 additions & 6 deletions wrappers/nodejs/test/test-videoframe.js
Original file line number Diff line number Diff line change
Expand Up @@ -105,12 +105,18 @@ describe('VideoFrame test', function() {
i.toUpperCase() !== 'FRAME_METADATA_COUNT' && // skip counter
i !== 'frameMetadataToString' // skip method
) {
assert.doesNotThrow(() => { // jshint ignore:line
frame.frameMetadata(rs2.frame_metadata[i]);
});
assert.equal(Object.prototype.toString.call(
frame.frameMetadata(rs2.frame_metadata[i])
), '[object Uint8Array]');
if (frame.supportsFrameMetadata(rs2.frame_metadata[i])) {
assert.doesNotThrow(() => { // jshint ignore:line
frame.frameMetadata(rs2.frame_metadata[i]);
});
assert.equal(Object.prototype.toString.call(
frame.frameMetadata(rs2.frame_metadata[i])
), '[object Uint8Array]');
} else {
assert.throws(() => { // jshint ignore:line
frame.frameMetadata(rs2.frame_metadata[i]);
});
}
}
}
});
Expand Down

0 comments on commit 991ed5c

Please sign in to comment.