This repository has been archived by the owner on Apr 3, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 97
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Initial version of realsense node javascript API testing
- Loading branch information
1 parent
f049a2a
commit 055828e
Showing
73 changed files
with
3,237 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
Copyright (c) 2016 Intel Corporation. | ||
|
||
Redistribution and use in source and binary forms, with or without modification, | ||
are permitted provided that the following conditions are met: | ||
|
||
* Redistributions of works must retain the original copyright notice, this list | ||
of conditions and the following disclaimer. | ||
* Redistributions in binary form must reproduce the original copyright notice, | ||
this list of conditions and the following disclaimer in the documentation | ||
and/or other materials provided with the distribution. | ||
* Neither the name of Intel Corporation nor the names of its contributors | ||
may be used to endorse or promote products derived from this work without | ||
specific prior written permission. | ||
|
||
THIS SOFTWARE IS PROVIDED BY INTEL CORPORATION "AS IS" | ||
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE | ||
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE | ||
ARE DISCLAIMED. IN NO EVENT SHALL INTEL CORPORATION BE LIABLE FOR ANY DIRECT, | ||
INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, | ||
BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, | ||
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY | ||
OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING | ||
NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, | ||
EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
# RealSense Node JavaScript Test Suite | ||
|
||
## Introduction | ||
|
||
This test suite is for checking compliance with RealSense node API specification: | ||
* https://github.com/otcshare/node-realsense/tree/master/src | ||
|
||
## Authors | ||
|
||
* Hao, Yunfei <[email protected]> | ||
* Zhao, Ming <[email protected]> | ||
|
||
## LICENSE | ||
|
||
Copyright (c) 2016 Intel Corporation. | ||
Except as noted, this software is licensed under BSD-3-Clause License. | ||
Please see the COPYING file for the BSD-3-Clause License. |
23 changes: 23 additions & 0 deletions
23
misc/nodeapi-realsense-tests/realsense/test-accessorder-enum-existence.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
"use strict" | ||
|
||
const assert = require('assert'); | ||
var module = require('./pt.js'); | ||
var enum_group = []; | ||
|
||
enum_group.push("access-order-by-id") | ||
|
||
enum_group.push('invalid'); | ||
|
||
function _test(i) { | ||
describe('check enum AccessOrder', function(){ | ||
it('checking member of AccessOrder: '+ enum_group[i], function(done) { | ||
|
||
TODO: | ||
|
||
}); | ||
}); | ||
} | ||
|
||
for (var x in enum_group) { | ||
_test(x); | ||
} |
36 changes: 36 additions & 0 deletions
36
misc/nodeapi-realsense-tests/realsense/test-boundingbox2dinfo-api-existence.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
"use strict" | ||
|
||
const assert = require("chai").assert; | ||
const path = require('path'); | ||
var addon; | ||
|
||
beforeEach(() => { | ||
}); | ||
|
||
afterEach(() => { | ||
}); | ||
|
||
describe('BoundingBox2DInfo API Test', function () { | ||
|
||
describe('API Existance', function() { | ||
it('addon.BoundingBox2DInfo is exist', function() { | ||
assert.isTrue(typeof(addon.BoundingBox2DInfo) !== 'undefined' ) | ||
}); | ||
|
||
it('addon.BoundingBox2DInfo type is correct', function() { | ||
assert.typeOf(addon.BoundingBox2DInfo,'function'); | ||
}); | ||
|
||
it('addon.BoundingBox2DInfo() object has a Rect attribute .rect', function () { | ||
var test_obj = addon[ii.newMap['BoundingBox2DInfo']]; | ||
assert.typeOf(test_obj.rect,'Rect'); | ||
}); | ||
|
||
it('addon.BoundingBox2DInfo() object has a number attribute .confidence', function () { | ||
var test_obj = addon[ii.newMap['BoundingBox2DInfo']]; | ||
assert.typeOf(test_obj.confidence,'number'); | ||
}); | ||
|
||
}); | ||
|
||
}); |
27 changes: 27 additions & 0 deletions
27
misc/nodeapi-realsense-tests/realsense/test-classifyresult-enum-existence.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
"use strict" | ||
|
||
const assert = require('assert'); | ||
var module = require('./pt.js'); | ||
var enum_group = []; | ||
|
||
enum_group.push("classified") | ||
|
||
enum_group.push("need-different-view-point") | ||
|
||
enum_group.push("not-classified") | ||
|
||
enum_group.push('invalid'); | ||
|
||
function _test(i) { | ||
describe('check enum ClassifyResult', function(){ | ||
it('checking member of ClassifyResult: '+ enum_group[i], function(done) { | ||
|
||
TODO: | ||
|
||
}); | ||
}); | ||
} | ||
|
||
for (var x in enum_group) { | ||
_test(x); | ||
} |
25 changes: 25 additions & 0 deletions
25
misc/nodeapi-realsense-tests/realsense/test-computeengine-enum-existence.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
"use strict" | ||
|
||
const assert = require('assert'); | ||
var module = require('./pt.js'); | ||
var enum_group = []; | ||
|
||
enum_group.push("CPU") | ||
|
||
enum_group.push("GPU") | ||
|
||
enum_group.push('invalid'); | ||
|
||
function _test(i) { | ||
describe('check enum ComputeEngine', function(){ | ||
it('checking member of ComputeEngine: '+ enum_group[i], function(done) { | ||
|
||
TODO: | ||
|
||
}); | ||
}); | ||
} | ||
|
||
for (var x in enum_group) { | ||
_test(x); | ||
} |
37 changes: 37 additions & 0 deletions
37
misc/nodeapi-realsense-tests/realsense/test-detectionmode-enum-existence.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
"use strict" | ||
|
||
const assert = require('assert'); | ||
var module = require('./pt.js'); | ||
var enum_group = []; | ||
|
||
enum_group.push("auto") | ||
|
||
enum_group.push("close-range") | ||
|
||
enum_group.push("mid-range") | ||
|
||
enum_group.push("far-range") | ||
|
||
enum_group.push("all") | ||
|
||
enum_group.push('invalid'); | ||
|
||
function _test(i) { | ||
describe('check enum DetectionMode', function(){ | ||
it('checking member of DetectionMode: '+ enum_group[i], function(done) { | ||
|
||
var cfg = {} | ||
cfg['detectMode']['tracking'] = enum_group[i]; | ||
var instance = new module.Instance(cfg); | ||
instance.getInstanceConfig().then(data => { | ||
assert.equal(data.tracking.detectMode, enum_group[i]); | ||
done(); | ||
}); | ||
|
||
}); | ||
}); | ||
} | ||
|
||
for (var x in enum_group) { | ||
_test(x); | ||
} |
36 changes: 36 additions & 0 deletions
36
misc/nodeapi-realsense-tests/realsense/test-eventdata-api-existence.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
"use strict" | ||
|
||
const assert = require("chai").assert; | ||
const path = require('path'); | ||
var addon; | ||
|
||
beforeEach(() => { | ||
}); | ||
|
||
afterEach(() => { | ||
}); | ||
|
||
describe('EventData API Test', function () { | ||
|
||
describe('API Existance', function() { | ||
it('addon.EventData is exist', function() { | ||
assert.isTrue(typeof(addon.EventData) !== 'undefined' ) | ||
}); | ||
|
||
it('addon.EventData type is correct', function() { | ||
assert.typeOf(addon.EventData,'function'); | ||
}); | ||
|
||
it('addon.EventData() object has a TrackingAccuracy attribute .accuracy', function () { | ||
var test_obj = addon[ii.newMap['EventData']]; | ||
assert.typeOf(test_obj.accuracy,'TrackingAccuracy'); | ||
}); | ||
|
||
it('addon.EventData() object has a number attribute .cameraPose', function () { | ||
var test_obj = addon[ii.newMap['EventData']]; | ||
assert.typeOf(test_obj.cameraPose,'number'); | ||
}); | ||
|
||
}); | ||
|
||
}); |
37 changes: 37 additions & 0 deletions
37
misc/nodeapi-realsense-tests/realsense/test-expression-enum-existence.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
"use strict" | ||
|
||
const assert = require('assert'); | ||
var module = require('./pt.js'); | ||
var enum_group = []; | ||
|
||
enum_group.push("neutral") | ||
|
||
enum_group.push("happiness") | ||
|
||
enum_group.push("sadness") | ||
|
||
enum_group.push("surprise") | ||
|
||
enum_group.push("fear") | ||
|
||
enum_group.push("anger") | ||
|
||
enum_group.push("disgust") | ||
|
||
enum_group.push("contempt") | ||
|
||
enum_group.push('invalid'); | ||
|
||
function _test(i) { | ||
describe('check enum Expression', function(){ | ||
it('checking member of Expression: '+ enum_group[i], function(done) { | ||
|
||
TODO: | ||
|
||
}); | ||
}); | ||
} | ||
|
||
for (var x in enum_group) { | ||
_test(x); | ||
} |
31 changes: 31 additions & 0 deletions
31
misc/nodeapi-realsense-tests/realsense/test-expressiondata-api-existence.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
"use strict" | ||
|
||
const assert = require("chai").assert; | ||
const path = require('path'); | ||
var addon; | ||
|
||
beforeEach(() => { | ||
}); | ||
|
||
afterEach(() => { | ||
}); | ||
|
||
describe('ExpressionData API Test', function () { | ||
|
||
describe('API Existance', function() { | ||
it('addon.ExpressionData is exist', function() { | ||
assert.isTrue(typeof(addon.ExpressionData) !== 'undefined' ) | ||
}); | ||
|
||
it('addon.ExpressionData type is correct', function() { | ||
assert.typeOf(addon.ExpressionData,'function'); | ||
}); | ||
|
||
it('addon.ExpressionData() object has a ExpressionInfo attribute .infos', function () { | ||
var test_obj = addon[ii.newMap['ExpressionData']]; | ||
assert.typeOf(test_obj.infos,'ExpressionInfo'); | ||
}); | ||
|
||
}); | ||
|
||
}); |
36 changes: 36 additions & 0 deletions
36
misc/nodeapi-realsense-tests/realsense/test-expressioninfo-api-existence.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
"use strict" | ||
|
||
const assert = require("chai").assert; | ||
const path = require('path'); | ||
var addon; | ||
|
||
beforeEach(() => { | ||
}); | ||
|
||
afterEach(() => { | ||
}); | ||
|
||
describe('ExpressionInfo API Test', function () { | ||
|
||
describe('API Existance', function() { | ||
it('addon.ExpressionInfo is exist', function() { | ||
assert.isTrue(typeof(addon.ExpressionInfo) !== 'undefined' ) | ||
}); | ||
|
||
it('addon.ExpressionInfo type is correct', function() { | ||
assert.typeOf(addon.ExpressionInfo,'function'); | ||
}); | ||
|
||
it('addon.ExpressionInfo() object has a Expression attribute .type', function () { | ||
var test_obj = addon[ii.newMap['ExpressionInfo']]; | ||
assert.typeOf(test_obj.type,'Expression'); | ||
}); | ||
|
||
it('addon.ExpressionInfo() object has a number attribute .confidence', function () { | ||
var test_obj = addon[ii.newMap['ExpressionInfo']]; | ||
assert.typeOf(test_obj.confidence,'number'); | ||
}); | ||
|
||
}); | ||
|
||
}); |
36 changes: 36 additions & 0 deletions
36
misc/nodeapi-realsense-tests/realsense/test-facelandmark-api-existence.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
"use strict" | ||
|
||
const assert = require("chai").assert; | ||
const path = require('path'); | ||
var addon; | ||
|
||
beforeEach(() => { | ||
}); | ||
|
||
afterEach(() => { | ||
}); | ||
|
||
describe('FaceLandmark API Test', function () { | ||
|
||
describe('API Existance', function() { | ||
it('addon.FaceLandmark is exist', function() { | ||
assert.isTrue(typeof(addon.FaceLandmark) !== 'undefined' ) | ||
}); | ||
|
||
it('addon.FaceLandmark type is correct', function() { | ||
assert.typeOf(addon.FaceLandmark,'function'); | ||
}); | ||
|
||
it('addon.FaceLandmark() object has a Point3D attribute .image', function () { | ||
var test_obj = addon[ii.newMap['FaceLandmark']]; | ||
assert.typeOf(test_obj.image,'Point3D'); | ||
}); | ||
|
||
it('addon.FaceLandmark() object has a Point3D attribute .world', function () { | ||
var test_obj = addon[ii.newMap['FaceLandmark']]; | ||
assert.typeOf(test_obj.world,'Point3D'); | ||
}); | ||
|
||
}); | ||
|
||
}); |
Oops, something went wrong.