Skip to content

Commit

Permalink
[nodejs] Add test case for devicelist test
Browse files Browse the repository at this point in the history
Impacted tests(approved): new 2, update 0, delete 0
Unit test platform: Ubuntu 16.04
Unit test result summary: pass 2, fail 0, block 0
  • Loading branch information
zhaoming0 authored and ev-mp committed Apr 17, 2018
1 parent 085ff23 commit 08a1800
Showing 1 changed file with 31 additions and 1 deletion.
32 changes: 31 additions & 1 deletion wrappers/nodejs/test/test-devicelist.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright (c) 2017 Intel Corporation. All rights reserved.
// Copyright (c) 2018 Intel Corporation. All rights reserved.
// Use of this source code is governed by an Apache 2.0 license
// that can be found in the LICENSE file.

Expand Down Expand Up @@ -45,6 +45,36 @@ describe('DeviceList test', function() {
assert.equal(typeof devl.size, 'number');
});

it('Testing member back', () => {
let dev = devl.devices;
assert(dev.length > 0); // Device must be connected
let device = devl.getDevice(dev.length -1);
let SN = device.getCameraInfo().serialNumber;
assert.doesNotThrow(() => {
if (devl.size > 0) {
let res = devl.back;
assert(devl.back instanceof rs2.Device);
assert.equal(typeof res, 'object');
assert.equal(res.getCameraInfo().serialNumber, SN);
}
});
});

it('Testing member front', () => {
let dev = devl.devices;
assert(dev.length > 0); // Device must be connected
let device = devl.getDevice(0);
let SN = device.getCameraInfo().serialNumber;
assert.doesNotThrow(() => {
if (devl.size > 0) {
let res = devl.front;
assert(devl.front instanceof rs2.Device);
assert.equal(typeof res, 'object');
assert.equal(res.getCameraInfo().serialNumber, SN);
}
});
});

it('Testing method destroy', () => {
assert.notEqual(devl.cxxList, undefined);
assert.doesNotThrow(() => {
Expand Down

0 comments on commit 08a1800

Please sign in to comment.