From 914ef73a0822a29f6c54911886a109a5d57f4787 Mon Sep 17 00:00:00 2001 From: Yunfei Hao Date: Tue, 25 Oct 2016 14:56:45 +0800 Subject: [PATCH] Initial version of realsense node javascript API testing --- misc/nodeapi-realsense-tests/COPYING | 24 ++ misc/nodeapi-realsense-tests/README.md | 17 + .../realsense-manual/common.js | 32 ++ .../test-boundingbox2dinfo-interface.js | 70 ++++ .../test-gestureinfo-interface.js | 55 +++ ...-instanceconfig-skeletonconfig-positive.js | 53 +++ ...-instanceconfig-trackingconfig-positive.js | 99 +++++ .../test-maskinfo-interface.js | 80 ++++ .../test-orientationinfo-interface.js | 68 ++++ .../test-personinfo-interface.js | 96 +++++ .../test-persontrackingresult-interface.js | 43 +++ .../test-point2d-interface.js | 114 ++++++ .../test-point3d-interface.js | 128 ++++++ .../test-pointcombinedinfo-interface.js | 93 +++++ .../test-pointinginfo-interface.js | 116 ++++++ .../test-poseeulerangles-interface.js | 80 ++++ .../test-skeletoninfo-interface.js | 45 +++ .../test-skeletonpointinfo-interface.js | 88 +++++ .../test-trackinginfo-interface.js | 125 ++++++ .../realsense-manual/test.js | 36 ++ .../realsense-manual/test_common.js | 45 +++ ...ns-disableAllExpressions-false-positive.js | 34 ++ ...ons-disableAllExpressions-true-positive.js | 34 ++ ...ecognitionOptions-enable-false-positive.js | 34 ++ ...RecognitionOptions-enable-true-positive.js | 34 ++ ...ons-enableAllExpressions-false-positive.js | 34 ++ ...ions-enableAllExpressions-true-positive.js | 34 ++ ...itionOptions-enableAnger-false-positive.js | 34 ++ ...nitionOptions-enableAnger-true-positive.js | 34 ++ ...onOptions-enableContempt-false-positive.js | 34 ++ ...ionOptions-enableContempt-true-positive.js | 34 ++ ...ionOptions-enableDisgust-false-positive.js | 34 ++ ...tionOptions-enableDisgust-true-positive.js | 34 ++ ...nitionOptions-enableFear-false-positive.js | 34 ++ ...gnitionOptions-enableFear-true-positive.js | 34 ++ ...itionOptions-enableHappy-false-positive.js | 34 ++ ...nitionOptions-enableHappy-true-positive.js | 34 ++ ...ionOptions-enableNeutral-false-positive.js | 34 ++ ...tionOptions-enableNeutral-true-positive.js | 34 ++ ...gnitionOptions-enableSad-false-positive.js | 34 ++ ...ognitionOptions-enableSad-true-positive.js | 34 ++ ...onOptions-enableSurprise-false-positive.js | 34 ++ ...ionOptions-enableSurprise-true-positive.js | 34 ++ ...tionOptions-maxTrackedPerson-1-positive.js | 34 ++ ...tionOptions-maxTrackedPerson-2-positive.js | 34 ++ ...ecognitionOptions-enable-false-positive.js | 34 ++ ...RecognitionOptions-enable-true-positive.js | 34 ++ ...gnitionOptions-policy-standard-positive.js | 34 ++ ...ionOptions-useMultiFrame-false-positive.js | 34 ++ ...tionOptions-useMultiFrame-true-positive.js | 34 ++ ...tions-disableAllGestures-false-positive.js | 34 ++ ...ptions-disableAllGestures-true-positive.js | 34 ++ ...ecognitionOptions-enable-false-positive.js | 34 ++ ...RecognitionOptions-enable-true-positive.js | 34 ++ ...ptions-enableAllGestures-false-positive.js | 34 ++ ...Options-enableAllGestures-true-positive.js | 34 ++ ...onOptions-enablePointing-false-positive.js | 34 ++ ...ionOptions-enablePointing-true-positive.js | 34 ++ ...tionOptions-maxTrackedPerson-1-positive.js | 34 ++ ...tionOptions-maxTrackedPerson-2-positive.js | 34 ++ ...ecognitionOptions-enable-false-positive.js | 34 ++ ...RecognitionOptions-enable-true-positive.js | 34 ++ ...tionOptions-maxTrackedPerson-1-positive.js | 34 ++ ...tionOptions-maxTrackedPerson-2-positive.js | 34 ++ ...ecognitionOptions-enable-false-positive.js | 34 ++ ...RecognitionOptions-enable-true-positive.js | 34 ++ ...tionOptions-maxTrackedPerson-1-positive.js | 34 ++ ...tionOptions-maxTrackedPerson-2-positive.js | 34 ++ ...ecognitionOptions-enable-false-positive.js | 34 ++ ...RecognitionOptions-enable-true-positive.js | 34 ++ ...tionOptions-maxTrackedPerson-1-positive.js | 34 ++ ...tionOptions-maxTrackedPerson-2-positive.js | 34 ++ ...Options-trackingArea-full-body-positive.js | 34 ++ ...s-trackingArea-full-body-rough-positive.js | 34 ++ ...ptions-trackingArea-upper-body-positive.js | 34 ++ ...-trackingArea-upper-body-rough-positive.js | 34 ++ .../test-facerecognition-api-existence.js | 73 ++++ .../realsense/test-instance-api-existence.js | 101 +++++ .../test-lyingposeinfo-api-existence.js | 85 ++++ ...test-lyingposerecognition-api-existence.js | 45 +++ .../test-persontracking-api-existence.js | 37 ++ .../test-recognitioninfo-api-existence.js | 71 ++++ ...trackingOptions-detectMode-all-positive.js | 34 ++ ...rackingOptions-detectMode-auto-positive.js | 34 ++ ...Options-detectMode-close-range-positive.js | 34 ++ ...ngOptions-detectMode-far-range-positive.js | 34 ++ ...gOptions-detectMode-full-range-positive.js | 34 ++ ...ngOptions-detectMode-mid-range-positive.js | 34 ++ ...t-trackingOptions-enable-false-positive.js | 34 ++ ...st-trackingOptions-enable-true-positive.js | 34 ++ ...ackingOptions-enableBlob-false-positive.js | 34 ++ ...rackingOptions-enableBlob-true-positive.js | 34 ++ ...s-enableDetectionFromFar-false-positive.js | 34 ++ ...ns-enableDetectionFromFar-true-positive.js | 34 ++ ...ions-enableFaceLandmarks-false-positive.js | 34 ++ ...tions-enableFaceLandmarks-true-positive.js | 34 ++ ...ns-enableHeadBoundingBox-false-positive.js | 34 ++ ...ons-enableHeadBoundingBox-true-positive.js | 34 ++ ...ngOptions-enableHeadPose-false-positive.js | 34 ++ ...ingOptions-enableHeadPose-true-positive.js | 34 ++ ...-enablePersonOrientation-false-positive.js | 34 ++ ...s-enablePersonOrientation-true-positive.js | 34 ++ ...tions-enableSegmentation-false-positive.js | 34 ++ ...ptions-enableSegmentation-true-positive.js | 34 ++ ...kingOptions-maxTrackedPerson-1-positive.js | 34 ++ ...kingOptions-maxTrackedPerson-2-positive.js | 34 ++ ...Options-trackingMode-following-positive.js | 34 ++ ...tions-trackingMode-interactive-positive.js | 34 ++ ...ons-trackingMode-single-person-positive.js | 34 ++ .../nodeapi-realsense-tests/realsense/util.js | 81 ++++ misc/nodeapi-realsense-tests/suite.json | 27 ++ .../testGen/generate-test-case.js | 119 ++++++ .../testGen/idl/pt.widl | 365 ++++++++++++++++++ .../testGen/interface_init.js | 7 + misc/nodeapi-realsense-tests/testGen/map.js | 12 + .../testGen/package.json | 23 ++ .../testGen/templates/apiExistence.dot | 62 +++ .../testGen/templates/enumExistence.dot | 42 ++ .../testGen/templates/map.def | 52 +++ .../testGen/templates/pt.js | 23 ++ .../testGen/templates/typeConversion.def | 42 ++ .../test-trackingangle-enum-existence.js | 35 ++ 122 files changed, 5597 insertions(+) create mode 100644 misc/nodeapi-realsense-tests/COPYING create mode 100644 misc/nodeapi-realsense-tests/README.md create mode 100644 misc/nodeapi-realsense-tests/realsense-manual/common.js create mode 100644 misc/nodeapi-realsense-tests/realsense-manual/test-boundingbox2dinfo-interface.js create mode 100644 misc/nodeapi-realsense-tests/realsense-manual/test-gestureinfo-interface.js create mode 100644 misc/nodeapi-realsense-tests/realsense-manual/test-instanceconfig-skeletonconfig-positive.js create mode 100644 misc/nodeapi-realsense-tests/realsense-manual/test-instanceconfig-trackingconfig-positive.js create mode 100644 misc/nodeapi-realsense-tests/realsense-manual/test-maskinfo-interface.js create mode 100644 misc/nodeapi-realsense-tests/realsense-manual/test-orientationinfo-interface.js create mode 100644 misc/nodeapi-realsense-tests/realsense-manual/test-personinfo-interface.js create mode 100644 misc/nodeapi-realsense-tests/realsense-manual/test-persontrackingresult-interface.js create mode 100644 misc/nodeapi-realsense-tests/realsense-manual/test-point2d-interface.js create mode 100644 misc/nodeapi-realsense-tests/realsense-manual/test-point3d-interface.js create mode 100644 misc/nodeapi-realsense-tests/realsense-manual/test-pointcombinedinfo-interface.js create mode 100644 misc/nodeapi-realsense-tests/realsense-manual/test-pointinginfo-interface.js create mode 100644 misc/nodeapi-realsense-tests/realsense-manual/test-poseeulerangles-interface.js create mode 100644 misc/nodeapi-realsense-tests/realsense-manual/test-skeletoninfo-interface.js create mode 100644 misc/nodeapi-realsense-tests/realsense-manual/test-skeletonpointinfo-interface.js create mode 100644 misc/nodeapi-realsense-tests/realsense-manual/test-trackinginfo-interface.js create mode 100644 misc/nodeapi-realsense-tests/realsense-manual/test.js create mode 100644 misc/nodeapi-realsense-tests/realsense-manual/test_common.js create mode 100644 misc/nodeapi-realsense-tests/realsense/expressionRecognitionOptions/test-expressionRecognitionOptions-disableAllExpressions-false-positive.js create mode 100644 misc/nodeapi-realsense-tests/realsense/expressionRecognitionOptions/test-expressionRecognitionOptions-disableAllExpressions-true-positive.js create mode 100644 misc/nodeapi-realsense-tests/realsense/expressionRecognitionOptions/test-expressionRecognitionOptions-enable-false-positive.js create mode 100644 misc/nodeapi-realsense-tests/realsense/expressionRecognitionOptions/test-expressionRecognitionOptions-enable-true-positive.js create mode 100644 misc/nodeapi-realsense-tests/realsense/expressionRecognitionOptions/test-expressionRecognitionOptions-enableAllExpressions-false-positive.js create mode 100644 misc/nodeapi-realsense-tests/realsense/expressionRecognitionOptions/test-expressionRecognitionOptions-enableAllExpressions-true-positive.js create mode 100644 misc/nodeapi-realsense-tests/realsense/expressionRecognitionOptions/test-expressionRecognitionOptions-enableAnger-false-positive.js create mode 100644 misc/nodeapi-realsense-tests/realsense/expressionRecognitionOptions/test-expressionRecognitionOptions-enableAnger-true-positive.js create mode 100644 misc/nodeapi-realsense-tests/realsense/expressionRecognitionOptions/test-expressionRecognitionOptions-enableContempt-false-positive.js create mode 100644 misc/nodeapi-realsense-tests/realsense/expressionRecognitionOptions/test-expressionRecognitionOptions-enableContempt-true-positive.js create mode 100644 misc/nodeapi-realsense-tests/realsense/expressionRecognitionOptions/test-expressionRecognitionOptions-enableDisgust-false-positive.js create mode 100644 misc/nodeapi-realsense-tests/realsense/expressionRecognitionOptions/test-expressionRecognitionOptions-enableDisgust-true-positive.js create mode 100644 misc/nodeapi-realsense-tests/realsense/expressionRecognitionOptions/test-expressionRecognitionOptions-enableFear-false-positive.js create mode 100644 misc/nodeapi-realsense-tests/realsense/expressionRecognitionOptions/test-expressionRecognitionOptions-enableFear-true-positive.js create mode 100644 misc/nodeapi-realsense-tests/realsense/expressionRecognitionOptions/test-expressionRecognitionOptions-enableHappy-false-positive.js create mode 100644 misc/nodeapi-realsense-tests/realsense/expressionRecognitionOptions/test-expressionRecognitionOptions-enableHappy-true-positive.js create mode 100644 misc/nodeapi-realsense-tests/realsense/expressionRecognitionOptions/test-expressionRecognitionOptions-enableNeutral-false-positive.js create mode 100644 misc/nodeapi-realsense-tests/realsense/expressionRecognitionOptions/test-expressionRecognitionOptions-enableNeutral-true-positive.js create mode 100644 misc/nodeapi-realsense-tests/realsense/expressionRecognitionOptions/test-expressionRecognitionOptions-enableSad-false-positive.js create mode 100644 misc/nodeapi-realsense-tests/realsense/expressionRecognitionOptions/test-expressionRecognitionOptions-enableSad-true-positive.js create mode 100644 misc/nodeapi-realsense-tests/realsense/expressionRecognitionOptions/test-expressionRecognitionOptions-enableSurprise-false-positive.js create mode 100644 misc/nodeapi-realsense-tests/realsense/expressionRecognitionOptions/test-expressionRecognitionOptions-enableSurprise-true-positive.js create mode 100644 misc/nodeapi-realsense-tests/realsense/expressionRecognitionOptions/test-expressionRecognitionOptions-maxTrackedPerson-1-positive.js create mode 100644 misc/nodeapi-realsense-tests/realsense/expressionRecognitionOptions/test-expressionRecognitionOptions-maxTrackedPerson-2-positive.js create mode 100644 misc/nodeapi-realsense-tests/realsense/faceRecognitionOptions/test-faceRecognitionOptions-enable-false-positive.js create mode 100644 misc/nodeapi-realsense-tests/realsense/faceRecognitionOptions/test-faceRecognitionOptions-enable-true-positive.js create mode 100644 misc/nodeapi-realsense-tests/realsense/faceRecognitionOptions/test-faceRecognitionOptions-policy-standard-positive.js create mode 100644 misc/nodeapi-realsense-tests/realsense/faceRecognitionOptions/test-faceRecognitionOptions-useMultiFrame-false-positive.js create mode 100644 misc/nodeapi-realsense-tests/realsense/faceRecognitionOptions/test-faceRecognitionOptions-useMultiFrame-true-positive.js create mode 100644 misc/nodeapi-realsense-tests/realsense/gestureRecognitionOptions/test-gestureRecognitionOptions-disableAllGestures-false-positive.js create mode 100644 misc/nodeapi-realsense-tests/realsense/gestureRecognitionOptions/test-gestureRecognitionOptions-disableAllGestures-true-positive.js create mode 100644 misc/nodeapi-realsense-tests/realsense/gestureRecognitionOptions/test-gestureRecognitionOptions-enable-false-positive.js create mode 100644 misc/nodeapi-realsense-tests/realsense/gestureRecognitionOptions/test-gestureRecognitionOptions-enable-true-positive.js create mode 100644 misc/nodeapi-realsense-tests/realsense/gestureRecognitionOptions/test-gestureRecognitionOptions-enableAllGestures-false-positive.js create mode 100644 misc/nodeapi-realsense-tests/realsense/gestureRecognitionOptions/test-gestureRecognitionOptions-enableAllGestures-true-positive.js create mode 100644 misc/nodeapi-realsense-tests/realsense/gestureRecognitionOptions/test-gestureRecognitionOptions-enablePointing-false-positive.js create mode 100644 misc/nodeapi-realsense-tests/realsense/gestureRecognitionOptions/test-gestureRecognitionOptions-enablePointing-true-positive.js create mode 100644 misc/nodeapi-realsense-tests/realsense/gestureRecognitionOptions/test-gestureRecognitionOptions-maxTrackedPerson-1-positive.js create mode 100644 misc/nodeapi-realsense-tests/realsense/gestureRecognitionOptions/test-gestureRecognitionOptions-maxTrackedPerson-2-positive.js create mode 100644 misc/nodeapi-realsense-tests/realsense/lyingPoseRecognitionOptions/test-lyingPoseRecognitionOptions-enable-false-positive.js create mode 100644 misc/nodeapi-realsense-tests/realsense/lyingPoseRecognitionOptions/test-lyingPoseRecognitionOptions-enable-true-positive.js create mode 100644 misc/nodeapi-realsense-tests/realsense/lyingPoseRecognitionOptions/test-lyingPoseRecognitionOptions-maxTrackedPerson-1-positive.js create mode 100644 misc/nodeapi-realsense-tests/realsense/lyingPoseRecognitionOptions/test-lyingPoseRecognitionOptions-maxTrackedPerson-2-positive.js create mode 100644 misc/nodeapi-realsense-tests/realsense/personPoseRecognitionOptions/test-personPoseRecognitionOptions-enable-false-positive.js create mode 100644 misc/nodeapi-realsense-tests/realsense/personPoseRecognitionOptions/test-personPoseRecognitionOptions-enable-true-positive.js create mode 100644 misc/nodeapi-realsense-tests/realsense/personPoseRecognitionOptions/test-personPoseRecognitionOptions-maxTrackedPerson-1-positive.js create mode 100644 misc/nodeapi-realsense-tests/realsense/personPoseRecognitionOptions/test-personPoseRecognitionOptions-maxTrackedPerson-2-positive.js create mode 100644 misc/nodeapi-realsense-tests/realsense/skeletonRecognitionOptions/test-skeletonRecognitionOptions-enable-false-positive.js create mode 100644 misc/nodeapi-realsense-tests/realsense/skeletonRecognitionOptions/test-skeletonRecognitionOptions-enable-true-positive.js create mode 100644 misc/nodeapi-realsense-tests/realsense/skeletonRecognitionOptions/test-skeletonRecognitionOptions-maxTrackedPerson-1-positive.js create mode 100644 misc/nodeapi-realsense-tests/realsense/skeletonRecognitionOptions/test-skeletonRecognitionOptions-maxTrackedPerson-2-positive.js create mode 100644 misc/nodeapi-realsense-tests/realsense/skeletonRecognitionOptions/test-skeletonRecognitionOptions-trackingArea-full-body-positive.js create mode 100644 misc/nodeapi-realsense-tests/realsense/skeletonRecognitionOptions/test-skeletonRecognitionOptions-trackingArea-full-body-rough-positive.js create mode 100644 misc/nodeapi-realsense-tests/realsense/skeletonRecognitionOptions/test-skeletonRecognitionOptions-trackingArea-upper-body-positive.js create mode 100644 misc/nodeapi-realsense-tests/realsense/skeletonRecognitionOptions/test-skeletonRecognitionOptions-trackingArea-upper-body-rough-positive.js create mode 100644 misc/nodeapi-realsense-tests/realsense/test-facerecognition-api-existence.js create mode 100644 misc/nodeapi-realsense-tests/realsense/test-instance-api-existence.js create mode 100644 misc/nodeapi-realsense-tests/realsense/test-lyingposeinfo-api-existence.js create mode 100644 misc/nodeapi-realsense-tests/realsense/test-lyingposerecognition-api-existence.js create mode 100644 misc/nodeapi-realsense-tests/realsense/test-persontracking-api-existence.js create mode 100644 misc/nodeapi-realsense-tests/realsense/test-recognitioninfo-api-existence.js create mode 100644 misc/nodeapi-realsense-tests/realsense/trackingOptions/test-trackingOptions-detectMode-all-positive.js create mode 100644 misc/nodeapi-realsense-tests/realsense/trackingOptions/test-trackingOptions-detectMode-auto-positive.js create mode 100644 misc/nodeapi-realsense-tests/realsense/trackingOptions/test-trackingOptions-detectMode-close-range-positive.js create mode 100644 misc/nodeapi-realsense-tests/realsense/trackingOptions/test-trackingOptions-detectMode-far-range-positive.js create mode 100644 misc/nodeapi-realsense-tests/realsense/trackingOptions/test-trackingOptions-detectMode-full-range-positive.js create mode 100644 misc/nodeapi-realsense-tests/realsense/trackingOptions/test-trackingOptions-detectMode-mid-range-positive.js create mode 100644 misc/nodeapi-realsense-tests/realsense/trackingOptions/test-trackingOptions-enable-false-positive.js create mode 100644 misc/nodeapi-realsense-tests/realsense/trackingOptions/test-trackingOptions-enable-true-positive.js create mode 100644 misc/nodeapi-realsense-tests/realsense/trackingOptions/test-trackingOptions-enableBlob-false-positive.js create mode 100644 misc/nodeapi-realsense-tests/realsense/trackingOptions/test-trackingOptions-enableBlob-true-positive.js create mode 100644 misc/nodeapi-realsense-tests/realsense/trackingOptions/test-trackingOptions-enableDetectionFromFar-false-positive.js create mode 100644 misc/nodeapi-realsense-tests/realsense/trackingOptions/test-trackingOptions-enableDetectionFromFar-true-positive.js create mode 100644 misc/nodeapi-realsense-tests/realsense/trackingOptions/test-trackingOptions-enableFaceLandmarks-false-positive.js create mode 100644 misc/nodeapi-realsense-tests/realsense/trackingOptions/test-trackingOptions-enableFaceLandmarks-true-positive.js create mode 100644 misc/nodeapi-realsense-tests/realsense/trackingOptions/test-trackingOptions-enableHeadBoundingBox-false-positive.js create mode 100644 misc/nodeapi-realsense-tests/realsense/trackingOptions/test-trackingOptions-enableHeadBoundingBox-true-positive.js create mode 100644 misc/nodeapi-realsense-tests/realsense/trackingOptions/test-trackingOptions-enableHeadPose-false-positive.js create mode 100644 misc/nodeapi-realsense-tests/realsense/trackingOptions/test-trackingOptions-enableHeadPose-true-positive.js create mode 100644 misc/nodeapi-realsense-tests/realsense/trackingOptions/test-trackingOptions-enablePersonOrientation-false-positive.js create mode 100644 misc/nodeapi-realsense-tests/realsense/trackingOptions/test-trackingOptions-enablePersonOrientation-true-positive.js create mode 100644 misc/nodeapi-realsense-tests/realsense/trackingOptions/test-trackingOptions-enableSegmentation-false-positive.js create mode 100644 misc/nodeapi-realsense-tests/realsense/trackingOptions/test-trackingOptions-enableSegmentation-true-positive.js create mode 100644 misc/nodeapi-realsense-tests/realsense/trackingOptions/test-trackingOptions-maxTrackedPerson-1-positive.js create mode 100644 misc/nodeapi-realsense-tests/realsense/trackingOptions/test-trackingOptions-maxTrackedPerson-2-positive.js create mode 100644 misc/nodeapi-realsense-tests/realsense/trackingOptions/test-trackingOptions-trackingMode-following-positive.js create mode 100644 misc/nodeapi-realsense-tests/realsense/trackingOptions/test-trackingOptions-trackingMode-interactive-positive.js create mode 100644 misc/nodeapi-realsense-tests/realsense/trackingOptions/test-trackingOptions-trackingMode-single-person-positive.js create mode 100644 misc/nodeapi-realsense-tests/realsense/util.js create mode 100644 misc/nodeapi-realsense-tests/suite.json create mode 100644 misc/nodeapi-realsense-tests/testGen/generate-test-case.js create mode 100644 misc/nodeapi-realsense-tests/testGen/idl/pt.widl create mode 100644 misc/nodeapi-realsense-tests/testGen/interface_init.js create mode 100644 misc/nodeapi-realsense-tests/testGen/map.js create mode 100644 misc/nodeapi-realsense-tests/testGen/package.json create mode 100644 misc/nodeapi-realsense-tests/testGen/templates/apiExistence.dot create mode 100644 misc/nodeapi-realsense-tests/testGen/templates/enumExistence.dot create mode 100644 misc/nodeapi-realsense-tests/testGen/templates/map.def create mode 100644 misc/nodeapi-realsense-tests/testGen/templates/pt.js create mode 100644 misc/nodeapi-realsense-tests/testGen/templates/typeConversion.def create mode 100644 misc/nodeapi-realsense-tests/testGen/test-trackingangle-enum-existence.js diff --git a/misc/nodeapi-realsense-tests/COPYING b/misc/nodeapi-realsense-tests/COPYING new file mode 100644 index 000000000..926ebc540 --- /dev/null +++ b/misc/nodeapi-realsense-tests/COPYING @@ -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. diff --git a/misc/nodeapi-realsense-tests/README.md b/misc/nodeapi-realsense-tests/README.md new file mode 100644 index 000000000..a16d1a0f7 --- /dev/null +++ b/misc/nodeapi-realsense-tests/README.md @@ -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 +* Zhao, Ming + +## 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. diff --git a/misc/nodeapi-realsense-tests/realsense-manual/common.js b/misc/nodeapi-realsense-tests/realsense-manual/common.js new file mode 100644 index 000000000..ebdba3e74 --- /dev/null +++ b/misc/nodeapi-realsense-tests/realsense-manual/common.js @@ -0,0 +1,32 @@ +var emitter = require('events').EventEmitter; +function inherits(target, source) { + for (var k in source.prototype) { + target.prototype[k] = source.prototype[k]; + } +} +function getInstance(module, instanceConfig, cameraConfig) { + var module = module; + inherits(module.Instance, emitter); + if (cameraConfig) { + return new module.Instance(instanceConfig, cameraConfig); + } else { + return new module.Instance(instanceConfig); + } +} +var getObj = function getObj(module, name, instanceConfig, cameraConfig) { + var m = getInstance(module, instanceConfig, cameraConfig); + if (name == 'Instance') { + return m; + } + if (name == 'PersonTracking') { + return m.personTracking + } + else if (name == 'SkelonArea') { + m.getInstanceConfig.then( + data => { + return data.skeleton.traingArea; + } + ); + } +} +exports.getObj = getObj; diff --git a/misc/nodeapi-realsense-tests/realsense-manual/test-boundingbox2dinfo-interface.js b/misc/nodeapi-realsense-tests/realsense-manual/test-boundingbox2dinfo-interface.js new file mode 100644 index 000000000..294ab224c --- /dev/null +++ b/misc/nodeapi-realsense-tests/realsense-manual/test-boundingbox2dinfo-interface.js @@ -0,0 +1,70 @@ +"use strict" +var emitter = require('events').EventEmitter; +const assert = require('assert'); +var module = require('bindings')('realsense_pt'); + +function inherits(target, source) { + for (var k in source.prototype) { + target.prototype[k] = source.prototype[k]; + } +} + +inherits(module.Instance, emitter); + +describe('check PersonTrackingResult', function(done){ + var PersonTrackingResult = null; + var persons = null; + var person =null; + + before(function(done){ + var instanceConfig = { + tracking: { + enable: true, + enableSegmentation: true, + enableHeadPose: true, + enableBlob: true, + enablePersonOrientation: true, + enableHeadBoundingBox: true, + enableFaceLandmarks: true, + enableDetectionFromFar: true, + maxTrackedPerson: 1, + trackingMode: 'following', + detectMode: 'auto' + } + } + var instance = new module.Instance(instanceConfig); + instance.on('persontracked', function(result) { + PersonTrackingResult = result; + persons = PersonTrackingResult.persons; + person = persons[0]; + done(); + }); + instance.start().then(function(){console.log('Start camera')}); + this.timeout(10000); + }) + it('check BoundingBox2DInfo interface: rect exist', function() { + var trackInfo = person.trackInfo; + var boundingBox = trackInfo.boundingBox; + var rect = boundingBox.rect; + assert.ok(rect); + }); + it('check BoundingBox2DInfo interface: rect type', function() { + var trackInfo = person.trackInfo; + var boundingBox = trackInfo.boundingBox; + var rect = boundingBox.rect; + assert.equal(typeof(rect), 'object'); + }); + it('check BoundingBox2DInfo interface: confidence exist', function() { + var trackInfo = person.trackInfo; + var boundingBox = trackInfo.boundingBox; + var confidence = boundingBox.confidence; + assert.ok(confidence); + }); + it('check BoundingBox2DInfo interface: confidence type', function() { + var trackInfo = person.trackInfo; + var boundingBox = trackInfo.boundingBox; + var confidence = boundingBox.confidence; + assert.equal(typeof(confidence), 'number'); + }); +}); + diff --git a/misc/nodeapi-realsense-tests/realsense-manual/test-gestureinfo-interface.js b/misc/nodeapi-realsense-tests/realsense-manual/test-gestureinfo-interface.js new file mode 100644 index 000000000..2f23fa199 --- /dev/null +++ b/misc/nodeapi-realsense-tests/realsense-manual/test-gestureinfo-interface.js @@ -0,0 +1,55 @@ +"use strict" +var emitter = require('events').EventEmitter; +const assert = require('assert'); +var module = require('bindings')('realsense_pt'); + +function inherits(target, source) { + for (var k in source.prototype) { + target.prototype[k] = source.prototype[k]; + } +} + +inherits(module.Instance, emitter); + +describe('check PersonTrackingResult', function(done){ + var PersonTrackingResult = null; + var persons = null; + var person =null; + + before(function(done){ + var instanceConfig = { + gesture: { + enable: true + } + } + var instance = new module.Instance(instanceConfig); + instance.on('persontracked', function(result) { + PersonTrackingResult = result; + persons = PersonTrackingResult.persons; + person = persons[0]; + done(); + }); + instance.start().then(function(){console.log('Start camera')}); + this.timeout(60000); + }) + it('check GestureData interface: isPointing exist', function() { + var gesttureInfo = person.gestureInfo; + var isPointing = gesttureInfo.isPointing; + assert.ok(isPointing != undefined); + }); + it('check GestureData interface: isPointing type', function() { + var gesttureInfo = person.gestureInfo; + var isPointing = gesttureInfo.isPointing; + assert.equal(typeof(isPointing), 'boolean'); + }); + it('check GestureData interface: thePointingInfo exist', function() { + var gesttureInfo = person.gestureInfo; + var thePointingInfo = gesttureInfo.thePointingInfo; + assert.ok(thePointingInfo != undefined); + }); + it('check GestureData interface: thePointingInfo type', function() { + var gesttureInfo = person.gestureInfo; + var thePointingInfo = gesttureInfo.thePointingInfo; + assert.equal(typeof(thePointingInfo), 'object'); + }); +}); diff --git a/misc/nodeapi-realsense-tests/realsense-manual/test-instanceconfig-skeletonconfig-positive.js b/misc/nodeapi-realsense-tests/realsense-manual/test-instanceconfig-skeletonconfig-positive.js new file mode 100644 index 000000000..305e7e7f2 --- /dev/null +++ b/misc/nodeapi-realsense-tests/realsense-manual/test-instanceconfig-skeletonconfig-positive.js @@ -0,0 +1,53 @@ +"use strict" +var emitter = require('events').EventEmitter; +const assert = require('assert'); +var module = require('bindings')('realsense_pt'); + +function inherits(target, source) { + for (var k in source.prototype) { + target.prototype[k] = source.prototype[k]; + } +} + +inherits(module.Instance, emitter); +var boolean_group = [true, false]; +var number_group = [0, 1, 2]; +var trackingArea = ['upper-body', 'upper-body-rough', 'full-body-rough', 'full-body']; + +var SkeletonConfig_enable = boolean_group; +var SkeletonConfig_maxTrackedPerson = number_group; +var SkeletonConfig_trackingArea = trackingArea; + +function _test(i) { + describe('check enum SkeletonArea', function(done){ + it('checking member of SkeletonArea: '+ i.enable + i.maxTrackedPerson + i.trackingArea, function(done) { + var cfg = {}; + cfg['skeleton'] = i; + console.log(cfg); + var instance = new module.Instance(cfg); + instance.start().then(function(){ + console.log('Start camera'); + instance.stop().then(function(){console.log('Stop camera');}); + assert.ok(true); + done(); + }).catch(function(){ + instance.stop().then(function(){console.log('Stop camera');}); + assert.ok(false); + done(); + }); + }); + }); +} + +for (var i in SkeletonConfig_enable) { + for (var j in SkeletonConfig_maxTrackedPerson) { + for (var k in SkeletonConfig_trackingArea) { + var config = {enable: SkeletonConfig_enable[i], + maxTrackedPerson: SkeletonConfig_maxTrackedPerson[j], + trackingArea: SkeletonConfig_trackingArea[k] + } + console.log(config); + _test(config); + } + } +} diff --git a/misc/nodeapi-realsense-tests/realsense-manual/test-instanceconfig-trackingconfig-positive.js b/misc/nodeapi-realsense-tests/realsense-manual/test-instanceconfig-trackingconfig-positive.js new file mode 100644 index 000000000..caf633ea8 --- /dev/null +++ b/misc/nodeapi-realsense-tests/realsense-manual/test-instanceconfig-trackingconfig-positive.js @@ -0,0 +1,99 @@ +"use strict" +var emitter = require('events').EventEmitter; +const assert = require('assert'); +var module = require('bindings')('realsense_pt'); + +function inherits(target, source) { + for (var k in source.prototype) { + target.prototype[k] = source.prototype[k]; + } +} + +inherits(module.Instance, emitter); +//var boolean_group = [true, false]; +var boolean_group = [true]; +//var number_group = [0, 1, 2]; +var number_group = [1]; +//var trackingMode = ['following', 'interactive', 'single-person']; +var trackingMode = ['following','interactive']; +//var detectMode = ['auto', 'close-range', 'mid-range', 'far-range', 'all']; +var detectMode = ['auto']; + +var TrackingConfig_enable = boolean_group; +var TrackingConfig_enableSegmentation = boolean_group; +var TrackingConfig_enableHeadPose = boolean_group; +var TrackingConfig_enableBlob = boolean_group; +var TrackingConfig_enablePersonOrientation = boolean_group; +var TrackingConfig_enableHeadBoundingBox = boolean_group; +var TrackingConfig_enableFaceLandmarks = boolean_group; +var TrackingConfig_enableDetectionFromFar = boolean_group; +var TrackingConfig_maxTrackedPerson = number_group; +var TrackingConfig_trackingMode = trackingMode; +var TrackingConfig_detectMode = detectMode; + +function _test(i) { + describe('check enum SkeletonArea', function(done){ + it('checking member of SkeletonArea: '+ + i.enable + ' ' + + i.enableSegmentation + ' ' + + i.enableHeadPose + ' ' + + i.enableBlob + ' ' + + i.enablePersonOrientation + ' ' + + i.enableHeadBoundingBox + ' ' + + i.enableFaceLandmarks + ' ' + + i.enableDetectionFromFar+ ' ' + + i.maxTrackedPerson+ ' ' + + i.trackingMode + ' ' + + i.detectMode, function(done) { + var cfg = {}; + cfg['tracking'] = i; + var instance = new module.Instance(cfg); + instance.start().then(function(){ + console.log('Start camera'); + //instance.stop().then(function(){console.log('Stop camera');}); + assert.ok(true); + done(); + }).catch(function(){ + //instance.stop().then(function(){console.log('Stop camera');}); + assert.ok(false); + done(); + }); + }); + }); +} + +for (var i in TrackingConfig_enable) { + for (var j in TrackingConfig_enableSegmentation) { + for (var k in TrackingConfig_enableHeadPose) { + for (var l in TrackingConfig_enableBlob) { + for (var m in TrackingConfig_enablePersonOrientation) { + for (var n in TrackingConfig_enableHeadBoundingBox) { + for (var o in TrackingConfig_enableFaceLandmarks) { + for (var p in TrackingConfig_enableDetectionFromFar) { + for (var q in TrackingConfig_maxTrackedPerson) { + for (var r in TrackingConfig_trackingMode) { + for (var s in TrackingConfig_detectMode) { + var config = {enable: TrackingConfig_enable[i], + enableSegmentation: TrackingConfig_enableSegmentation[j], + enableHeadPose: TrackingConfig_enableHeadPose[k], + enableBlob: TrackingConfig_enableBlob[l], + enablePersonOrientation: TrackingConfig_enablePersonOrientation[m], + enableHeadBoundingBox: TrackingConfig_enableHeadBoundingBox[n], + enableFaceLandmarks: TrackingConfig_enableFaceLandmarks[o], + enableDetectionFromFar: TrackingConfig_enableDetectionFromFar[p], + maxTrackedPerson: TrackingConfig_maxTrackedPerson[q], + trackingMode: TrackingConfig_trackingMode[r], + detectMode: TrackingConfig_detectMode[s] + } + _test(config); + } + } + } + } + } + } + } + } + } + } +} diff --git a/misc/nodeapi-realsense-tests/realsense-manual/test-maskinfo-interface.js b/misc/nodeapi-realsense-tests/realsense-manual/test-maskinfo-interface.js new file mode 100644 index 000000000..16363c669 --- /dev/null +++ b/misc/nodeapi-realsense-tests/realsense-manual/test-maskinfo-interface.js @@ -0,0 +1,80 @@ +"use strict" +var emitter = require('events').EventEmitter; +const assert = require('assert'); +var module = require('bindings')('realsense_pt'); + +function inherits(target, source) { + for (var k in source.prototype) { + target.prototype[k] = source.prototype[k]; + } +} + +inherits(module.Instance, emitter); + +describe('check PersonTrackingResult', function(done){ + var PersonTrackingResult = null; + var persons = null; + var person =null; + + before(function(done){ + var instanceConfig = { + tracking: { + enable: true, + enableSegmentation: true, + enableHeadPose: true, + enableBlob: true, + enablePersonOrientation: true, + enableHeadBoundingBox: true, + enableFaceLandmarks: true, + enableDetectionFromFar: true, + maxTrackedPerson: 1, + detectMode: 'auto' + } + } + var instance = new module.Instance(instanceConfig); + instance.on('persontracked', function(result) { + PersonTrackingResult = result; + persons = PersonTrackingResult.persons; + person = persons[0]; + done(); + }); + instance.start().then(function(){console.log('Start camera')}); + this.timeout(10000); + }) + it('check MaskInfo interface: width exist', function() { + var trackInfo = person.trackInfo; + var blobMask = trackInfo.blobMask; + var width = blobMask.width; + assert.ok(width != undefined); + }); + it('check MaskInfo interface: width type', function() { + var trackInfo = person.trackInfo; + var blobMask = trackInfo.blobMask; + var width = blobMask.width; + assert.equal(typeof(width), 'number'); + }); + it('check MaskInfo interface: height exist', function() { + var trackInfo = person.trackInfo; + var blobMask = trackInfo.blobMask; + var height = blobMask.height; + assert.ok(height != undefined); + }); + it('check MaskInfo interface: height type', function() { + var trackInfo = person.trackInfo; + var blobMask = trackInfo.blobMask; + var height = blobMask.height; + assert.equal(typeof(height), 'number'); + }); + it('check MaskInfo interface: maskData exist', function() { + var trackInfo = person.trackInfo; + var blobMask = trackInfo.blobMask; + var maskData= blobMask.maskData; + assert.ok(maskData != undefined); + }); + it('check MaskInfo interface: maskData type', function() { + var trackInfo = person.trackInfo; + var blobMask = trackInfo.blobMask; + var maskData= blobMask.maskData; + assert.equal(typeof(maskData), 'object'); + }); +}); diff --git a/misc/nodeapi-realsense-tests/realsense-manual/test-orientationinfo-interface.js b/misc/nodeapi-realsense-tests/realsense-manual/test-orientationinfo-interface.js new file mode 100644 index 000000000..6d1bd0aff --- /dev/null +++ b/misc/nodeapi-realsense-tests/realsense-manual/test-orientationinfo-interface.js @@ -0,0 +1,68 @@ +"use strict" +var emitter = require('events').EventEmitter; +const assert = require('assert'); +var module = require('bindings')('realsense_pt'); + +function inherits(target, source) { + for (var k in source.prototype) { + target.prototype[k] = source.prototype[k]; + } +} + +inherits(module.Instance, emitter); + +describe('check PersonTrackingResult', function(done){ + var PersonTrackingResult = null; + var persons = null; + var person =null; + + before(function(done){ + var instanceConfig = { + tracking: { + enable: true, + enableSegmentation: true, + enableHeadPose: true, + enableBlob: true, + enablePersonOrientation: true, + enableHeadBoundingBox: true, + enableFaceLandmarks: true, + enableDetectionFromFar: true, + maxTrackedPerson: 1, + detectMode: 'auto' + } + } + var instance = new module.Instance(instanceConfig); + instance.on('persontracked', function(result) { + PersonTrackingResult = result; + persons = PersonTrackingResult.persons; + person = persons[0]; + done(); + }); + instance.start().then(function(){console.log('Start camera')}); + this.timeout(10000); + }) + it('check OrientationInfo interface: orientType exist', function() { + var trackInfo = person.trackInfo; + var orient = trackInfo.orient; + var orientType = orient.orientType; + assert.ok(orientType != undefined); + }); + it('check OrientationInfo interface: orientType type', function() { + var trackInfo = person.trackInfo; + var orient = trackInfo.orient; + var orientType = orient.orientType; + assert.equal(typeof(orientType), 'string'); + }); + it('check OrientationInfo interface: confidence exist', function() { + var trackInfo = person.trackInfo; + var orient = trackInfo.orient; + var confidence = orient.confidence; + assert.ok(confidence != undefined); + }); + it('check OrientationInfo interface: confidence type', function() { + var trackInfo = person.trackInfo; + var orient = trackInfo.orient; + var confidence = orient.confidence; + assert.equal(typeof(confidence), 'number'); + }); +}); diff --git a/misc/nodeapi-realsense-tests/realsense-manual/test-personinfo-interface.js b/misc/nodeapi-realsense-tests/realsense-manual/test-personinfo-interface.js new file mode 100644 index 000000000..6c33d4e3e --- /dev/null +++ b/misc/nodeapi-realsense-tests/realsense-manual/test-personinfo-interface.js @@ -0,0 +1,96 @@ +"use strict" +var emitter = require('events').EventEmitter; +const assert = require('assert'); +var module = require('bindings')('realsense_pt'); + +function inherits(target, source) { + for (var k in source.prototype) { + target.prototype[k] = source.prototype[k]; + } +} + +inherits(module.Instance, emitter); + +describe('check PersonTrackingResult', function(done){ + var PersonTrackingResult = null; + var persons = null; + var person =null; + + before(function(done){ + var instanceConfig = { + skeleton: { + enable: true + }, + tracking: { + enable: true + }, + face: { + enable: true + }, + gesture: { + enable: true + }, + expression: { + enable: true + } + } + var instance = new module.Instance(instanceConfig); + instance.on('persontracked', function(result) { + PersonTrackingResult = result; + persons = PersonTrackingResult.persons; + person = persons[0]; + done(); + }); + instance.start().then(function(){console.log('Start camera')}); + this.timeout(10000); + }) + it('check personInfo interface: SkeletonData exist', function() { + var skeletonInfo = person.skeletonInfo; + assert.ok(skeletonInfo); + }); + it('check personInfo interface: SkeletonData type', function() { + var skeletonInfo = person.skeletonInfo; + assert.ok(typeof(skeletonInfo) == 'object'); + }); + it('check personInfo interface: TrackingData exist', function() { + var trackInfo = person.trackInfo; + assert.ok(trackInfo); + }); + it('check personInfo interface: TrackingData type', function() { + var trackInfo = person.trackInfo; + assert.ok(typeof(trackInfo) == 'object'); + }); + it('check personInfo interface: gestureInfo exist', function() { + var gestureInfo = person.gestureInfo; + assert.ok(gestureInfo); + }); + it('check personInfo interface: gestureInfo type', function() { + var gestureInfo = person.gestureInfo; + assert.ok(typeof(gestureInfo) == 'object'); + }); + it('check personInfo interface: expressionInfo exist', function() { + var expressInfo = person.expressionInfo; + assert.ok(expressInfo); + }); + it('check personInfo interface: expressInfo type', function() { + var expressInfo = person.expressInfo; + assert.ok(typeof(expressInfo) == 'object'); + }); + it('check personInfo interface: landmarkInfo exist', function() { + var landmarkInfo = person.landmarkInfo; + assert.ok(landmarkInfo); + }); + it('check personInfo interface: landmarkInfo type', function() { + var landmarkInfo = person.landmarkInfo; + assert.ok(typeof(landmarkInfo) == 'object'); + }); + it('check personInfo interface: poseInfo exist', function() { + var poseInfo = person.poseInfo; + assert.ok(poseInfo); + }); + it('check personInfo interface: poseInfo type', function() { + var poseInfo = person.poseInfo; + assert.ok(typeof(poseInfo) == 'object'); + }); +}); + diff --git a/misc/nodeapi-realsense-tests/realsense-manual/test-persontrackingresult-interface.js b/misc/nodeapi-realsense-tests/realsense-manual/test-persontrackingresult-interface.js new file mode 100644 index 000000000..cd6b55ad5 --- /dev/null +++ b/misc/nodeapi-realsense-tests/realsense-manual/test-persontrackingresult-interface.js @@ -0,0 +1,43 @@ +"use strict" +var emitter = require('events').EventEmitter; +const assert = require('assert'); +var module = require('bindings')('realsense_pt'); + +function inherits(target, source) { + for (var k in source.prototype) { + target.prototype[k] = source.prototype[k]; + } +} + +inherits(module.Instance, emitter); + +describe('check PersonTrackingResult', function(done){ + var PersonTrackingResult = null; + var persons = null; + + before(function(done){ + var instanceConfig = { + tracking: { + enable: true, + } + } + var instance = new module.Instance(instanceConfig); + instance.on('persontracked', function(result) { + PersonTrackingResult = result; + persons = PersonTrackingResult.persons; + done(); + }); + instance.start().then(function(){console.log('Start camera')}); + this.timeout(10000); + }) + it('get PersonTrackingResult', function() { + assert.ok(PersonTrackingResult!=null); + }); + it('get persons of PersonTrackingResult', function() { + var len = persons.length; + assert.ok(persons != null && persons != undefined); + assert.ok(typeof(persons) == 'object'); + assert.ok(len>0); + }); +}); + diff --git a/misc/nodeapi-realsense-tests/realsense-manual/test-point2d-interface.js b/misc/nodeapi-realsense-tests/realsense-manual/test-point2d-interface.js new file mode 100644 index 000000000..05975d486 --- /dev/null +++ b/misc/nodeapi-realsense-tests/realsense-manual/test-point2d-interface.js @@ -0,0 +1,114 @@ +"use strict" +var emitter = require('events').EventEmitter; +const assert = require('assert'); +var module = require('bindings')('realsense_pt'); + +function inherits(target, source) { + for (var k in source.prototype) { + target.prototype[k] = source.prototype[k]; + } +} + +inherits(module.Instance, emitter); + +describe('check PersonTrackingResult', function(done){ + var PersonTrackingResult = null; + var persons = null; + var person =null; + + before(function(done){ + var instanceConfig = { + tracking: { + enable: true, + enableSegmentation: true, + enableHeadPose: true, + enableBlob: true, + enablePersonOrientation: true, + enableHeadBoundingBox: true, + enableFaceLandmarks: true, + enableDetectionFromFar: true, + maxTrackedPerson: 1, + detectMode: 'auto' + } + } + var instance = new module.Instance(instanceConfig); + instance.on('persontracked', function(result) { + PersonTrackingResult = result; + persons = PersonTrackingResult.persons; + person = persons[0]; + done(); + }); + instance.start().then(function(){console.log('Start camera')}); + this.timeout(10000); + }) + it('check Point2D interface: x exist', function() { + var gesttureInfo = person.gestureInfo; + var thePointingInfo = gesttureInfo.thePointingInfo; + var worldOrigin = thePointingInfo.worldOrigin; + var x = worldOrigin.x; + assert.ok(x != undefined); + }); + it('check Point2D interface: x type', function() { + var gesttureInfo = person.gestureInfo; + var thePointingInfo = gesttureInfo.thePointingInfo; + var worldOrigin = thePointingInfo.worldOrigin; + var x = worldOrigin.x; + assert.equal(typeof(x), 'number'); + }); + it('check Point2D interface: y exist', function() { + var gesttureInfo = person.gestureInfo; + var thePointingInfo = gesttureInfo.thePointingInfo; + var worldOrigin = thePointingInfo.worldOrigin; + var y = worldOrigin.y; + assert.ok(y != undefined); + }); + it('check Point2D interface: y type', function() { + var gesttureInfo = person.gestureInfo; + var thePointingInfo = gesttureInfo.thePointingInfo; + var worldOrigin = thePointingInfo.worldOrigin; + var y = worldOrigin.y; + assert.equal(typeof(y), 'number'); + }); + it('check Point2D interface: setCoords exist', function() { + var gesttureInfo = person.gestureInfo; + var thePointingInfo = gesttureInfo.thePointingInfo; + var worldOrigin = thePointingInfo.worldOrigin; + var testObj = worldOrigin.setCoords; + assert.ok(testObj != undefined); + }); + it('check Point2D interface: setCoords type', function() { + var gesttureInfo = person.gestureInfo; + var thePointingInfo = gesttureInfo.thePointingInfo; + var worldOrigin = thePointingInfo.worldOrigin; + var testObj = worldOrigin.setCoords; + assert.equal(tzpeof(testObj), 'function'); + }); + it('check Point2D interface: equal exist', function() { + var gesttureInfo = person.gestureInfo; + var thePointingInfo = gesttureInfo.thePointingInfo; + var worldOrigin = thePointingInfo.worldOrigin; + var testObj = worldOrigin.equal; + assert.ok(testObj != undefined); + }); + it('check Point2D interface: equal type', function() { + var gesttureInfo = person.gestureInfo; + var thePointingInfo = gesttureInfo.thePointingInfo; + var worldOrigin = thePointingInfo.worldOrigin; + var testObj = worldOrigin.equal; + assert.equal(tzpeof(testObj), 'function'); + }); + it('check Point2D interface: distance exist', function() { + var gesttureInfo = person.gestureInfo; + var thePointingInfo = gesttureInfo.thePointingInfo; + var worldOrigin = thePointingInfo.worldOrigin; + var testObj = worldOrigin.distance; + assert.ok(testObj != undefined); + }); + it('check Point2D interface: distance type', function() { + var gesttureInfo = person.gestureInfo; + var thePointingInfo = gesttureInfo.thePointingInfo; + var worldOrigin = thePointingInfo.worldOrigin; + var testObj = worldOrigin.distance; + assert.equal(tzpeof(testObj), 'number'); + }); +}); diff --git a/misc/nodeapi-realsense-tests/realsense-manual/test-point3d-interface.js b/misc/nodeapi-realsense-tests/realsense-manual/test-point3d-interface.js new file mode 100644 index 000000000..6bf1a3bec --- /dev/null +++ b/misc/nodeapi-realsense-tests/realsense-manual/test-point3d-interface.js @@ -0,0 +1,128 @@ +"use strict" +var emitter = require('events').EventEmitter; +const assert = require('assert'); +var module = require('bindings')('realsense_pt'); + +function inherits(target, source) { + for (var k in source.prototype) { + target.prototype[k] = source.prototype[k]; + } +} + +inherits(module.Instance, emitter); + +describe('check PersonTrackingResult', function(done){ + var PersonTrackingResult = null; + var persons = null; + var person =null; + + before(function(done){ + var instanceConfig = { + tracking: { + enable: true, + enableSegmentation: true, + enableHeadPose: true, + enableBlob: true, + enablePersonOrientation: true, + enableHeadBoundingBox: true, + enableFaceLandmarks: true, + enableDetectionFromFar: true, + maxTrackedPerson: 1, + detectMode: 'auto' + } + } + var instance = new module.Instance(instanceConfig); + instance.on('persontracked', function(result) { + PersonTrackingResult = result; + persons = PersonTrackingResult.persons; + person = persons[0]; + done(); + }); + instance.start().then(function(){console.log('Start camera')}); + this.timeout(10000); + }) + it('check Point3D interface: x exist', function() { + var gesttureInfo = person.gestureInfo; + var thePointingInfo = gesttureInfo.thePointingInfo; + var worldOrigin = thePointingInfo.worldOrigin; + var x = worldOrigin.x; + assert.ok(x != undefined); + }); + it('check Point3D interface: x type', function() { + var gesttureInfo = person.gestureInfo; + var thePointingInfo = gesttureInfo.thePointingInfo; + var worldOrigin = thePointingInfo.worldOrigin; + var x = worldOrigin.x; + assert.equal(typeof(x), 'number'); + }); + it('check Point3D interface: y exist', function() { + var gesttureInfo = person.gestureInfo; + var thePointingInfo = gesttureInfo.thePointingInfo; + var worldOrigin = thePointingInfo.worldOrigin; + var y = worldOrigin.y; + assert.ok(y != undefined); + }); + it('check Point3D interface: y type', function() { + var gesttureInfo = person.gestureInfo; + var thePointingInfo = gesttureInfo.thePointingInfo; + var worldOrigin = thePointingInfo.worldOrigin; + var y = worldOrigin.y; + assert.equal(typeof(y), 'number'); + }); + it('check Point3D interface: z exist', function() { + var gesttureInfo = person.gestureInfo; + var thePointingInfo = gesttureInfo.thePointingInfo; + var worldOrigin = thePointingInfo.worldOrigin; + var z = worldOrigin.z; + assert.ok(z != undefined); + }); + it('check Point3D interface: z type', function() { + var gesttureInfo = person.gestureInfo; + var thePointingInfo = gesttureInfo.thePointingInfo; + var worldOrigin = thePointingInfo.worldOrigin; + var z = worldOrigin.z; + assert.equal(tzpeof(z), 'number'); + }); + it('check Point3D interface: setCoords exist', function() { + var gesttureInfo = person.gestureInfo; + var thePointingInfo = gesttureInfo.thePointingInfo; + var worldOrigin = thePointingInfo.worldOrigin; + var testObj = worldOrigin.setCoords; + assert.ok(testObj != undefined); + }); + it('check Point3D interface: setCoords type', function() { + var gesttureInfo = person.gestureInfo; + var thePointingInfo = gesttureInfo.thePointingInfo; + var worldOrigin = thePointingInfo.worldOrigin; + var testObj = worldOrigin.setCoords; + assert.equal(tzpeof(testObj), 'function'); + }); + it('check Point3D interface: equal exist', function() { + var gesttureInfo = person.gestureInfo; + var thePointingInfo = gesttureInfo.thePointingInfo; + var worldOrigin = thePointingInfo.worldOrigin; + var testObj = worldOrigin.equal; + assert.ok(testObj != undefined); + }); + it('check Point3D interface: equal type', function() { + var gesttureInfo = person.gestureInfo; + var thePointingInfo = gesttureInfo.thePointingInfo; + var worldOrigin = thePointingInfo.worldOrigin; + var testObj = worldOrigin.equal; + assert.equal(tzpeof(testObj), 'function'); + }); + it('check Point3D interface: distance exist', function() { + var gesttureInfo = person.gestureInfo; + var thePointingInfo = gesttureInfo.thePointingInfo; + var worldOrigin = thePointingInfo.worldOrigin; + var testObj = worldOrigin.distance; + assert.ok(testObj != undefined); + }); + it('check Point3D interface: distance type', function() { + var gesttureInfo = person.gestureInfo; + var thePointingInfo = gesttureInfo.thePointingInfo; + var worldOrigin = thePointingInfo.worldOrigin; + var testObj = worldOrigin.distance; + assert.equal(tzpeof(testObj), 'number'); + }); +}); diff --git a/misc/nodeapi-realsense-tests/realsense-manual/test-pointcombinedinfo-interface.js b/misc/nodeapi-realsense-tests/realsense-manual/test-pointcombinedinfo-interface.js new file mode 100644 index 000000000..b8fd98cc6 --- /dev/null +++ b/misc/nodeapi-realsense-tests/realsense-manual/test-pointcombinedinfo-interface.js @@ -0,0 +1,93 @@ +"use strict" +var emitter = require('events').EventEmitter; +const assert = require('assert'); +var module = require('bindings')('realsense_pt'); + +function inherits(target, source) { + for (var k in source.prototype) { + target.prototype[k] = source.prototype[k]; + } +} + +inherits(module.Instance, emitter); + +describe('check PersonTrackingResult', function(done){ + var PersonTrackingResult = null; + var persons = null; + var person =null; + + before(function(done){ + var instanceConfig = { + tracking: { + enable: true, + enableSegmentation: true, + enableHeadPose: true, + enableBlob: true, + enablePersonOrientation: true, + enableHeadBoundingBox: true, + enableFaceLandmarks: true, + enableDetectionFromFar: true, + maxTrackedPerson: 1, + detectMode: 'auto' + } + } + var instance = new module.Instance(instanceConfig); + instance.on('persontracked', function(result) { + PersonTrackingResult = result; + persons = PersonTrackingResult.persons; + person = persons[0]; + done(); + }); + instance.start().then(function(){console.log('Start camera')}); + this.timeout(10000); + }) + it('check PointCombinedInfo interface: rect exist', function() { + var trackInfo = person.trackInfo; + var center= trackInfo.center; + var worldCoordinate = center.worldCoordinate; + assert.ok(worldCoordinate); + }); + it('check PointCombinedInfo interface: rect type', function() { + var trackInfo = person.trackInfo; + var center= trackInfo.center; + var worldCoordinate = center.worldCoordinate; + assert.equal(typeof(worldCoordinate), 'object'); + }); + it('check PointCombinedInfo interface: imageCoordinate exist', function() { + var trackInfo = person.trackInfo; + var center= trackInfo.center; + var imageCoordinate = center.imageCoordinate; + assert.ok(imageCoordinate); + }); + it('check PointCombinedInfo interface: imageCoordinate type', function() { + var trackInfo = person.trackInfo; + var center= trackInfo.center; + var imageCoordinate = center.imageCoordinate; + assert.equal(typeof(imageCoordinate), 'object'); + }); + it('check PointCombinedInfo interface: worldConfidence exist', function() { + var trackInfo = person.trackInfo; + var center= trackInfo.center; + var worldConfidence = center.worldConfidence; + assert.ok(worldConfidence); + }); + it('check PointCombinedInfo interface: worldConfidence type', function() { + var trackInfo = person.trackInfo; + var center= trackInfo.center; + var worldConfidence = center.worldConfidence; + assert.equal(typeof(worldConfidence), 'number'); + }); + it('check PointCombinedInfo interface: imageConfidence exist', function() { + var trackInfo = person.trackInfo; + var center= trackInfo.center; + var imageConfidence = center.imageConfidence; + assert.ok(imageConfidence); + }); + it('check PointCombinedInfo interface: imageConfidence type', function() { + var trackInfo = person.trackInfo; + var center= trackInfo.center; + var imageConfidence = center.imageConfidence; + assert.equal(typeof(imageConfidence), 'number'); + }); +}); + diff --git a/misc/nodeapi-realsense-tests/realsense-manual/test-pointinginfo-interface.js b/misc/nodeapi-realsense-tests/realsense-manual/test-pointinginfo-interface.js new file mode 100644 index 000000000..156bee7a9 --- /dev/null +++ b/misc/nodeapi-realsense-tests/realsense-manual/test-pointinginfo-interface.js @@ -0,0 +1,116 @@ +"use strict" +var emitter = require('events').EventEmitter; +const assert = require('assert'); +var module = require('bindings')('realsense_pt'); + +function inherits(target, source) { + for (var k in source.prototype) { + target.prototype[k] = source.prototype[k]; + } +} + +inherits(module.Instance, emitter); + +describe('check PersonTrackingResult', function(done){ + var PersonTrackingResult = null; + var persons = null; + var person =null; + + before(function(done){ + var instanceConfig = { + tracking: { + enable: true, + enableSegmentation: true, + enableHeadPose: true, + enableBlob: true, + enablePersonOrientation: true, + enableHeadBoundingBox: true, + enableFaceLandmarks: true, + enableDetectionFromFar: true, + maxTrackedPerson: 1, + detectMode: 'auto' + } + } + var instance = new module.Instance(instanceConfig); + instance.on('persontracked', function(result) { + PersonTrackingResult = result; + persons = PersonTrackingResult.persons; + person = persons[0]; + done(); + }); + instance.start().then(function(){console.log('Start camera')}); + this.timeout(10000); + }) + it('check PointingInfo interface: worldOrigin exist', function() { + var gesttureInfo = person.gestureInfo; + var thePointingInfo = gesttureInfo.thePointingInfo; + var worldOrigin = thePointingInfo.worldOrigin; + assert.ok(worldOrigin != undefined); + }); + it('check PointingInfo interface: worldOrigin type', function() { + var gesttureInfo = person.gestureInfo; + var thePointingInfo = gesttureInfo.thePointingInfo; + var worldOrigin = thePointingInfo.worldOrigin; + assert.equal(typeof(worldOrigin), 'object'); + }); + it('check PointingInfo interface: worldDirection exist', function() { + var gesttureInfo = person.gestureInfo; + var thePointingInfo = gesttureInfo.thePointingInfo; + var worldDirection = thePointingInfo.worldDirection; + assert.ok(worldDirection != undefined); + }); + it('check PointingInfo interface: worldDirection type', function() { + var gesttureInfo = person.gestureInfo; + var thePointingInfo = gesttureInfo.thePointingInfo; + var worldDirection = thePointingInfo.worldDirection; + assert.equal(typeof(worldDirection), 'object'); + }); + it('check PointingInfo interface: imageOrigin exist', function() { + var gesttureInfo = person.gestureInfo; + var thePointingInfo = gesttureInfo.thePointingInfo; + var imageOrigin = thePointingInfo.imageOrigin; + assert.ok(imageOrigin != undefined); + }); + it('check PointingInfo interface: imageOrigin type', function() { + var gesttureInfo = person.gestureInfo; + var thePointingInfo = gesttureInfo.thePointingInfo; + var imageOrigin = thePointingInfo.imageOrigin; + assert.equal(typeof(imageOrigin), 'object'); + }); + it('check PointingInfo interface: imageDirection exist', function() { + var gesttureInfo = person.gestureInfo; + var thePointingInfo = gesttureInfo.thePointingInfo; + var imageDirection = thePointingInfo.imageDirection; + assert.ok(imageDirection != undefined); + }); + it('check PointingInfo interface: imageDirection type', function() { + var gesttureInfo = person.gestureInfo; + var thePointingInfo = gesttureInfo.thePointingInfo; + var imageDirection = thePointingInfo.imageDirection; + assert.equal(typeof(imageDirection), 'object'); + }); + it('check PointingInfo interface: confidence exist', function() { + var gesttureInfo = person.gestureInfo; + var thePointingInfo = gesttureInfo.thePointingInfo; + var confidence = thePointingInfo.confidence; + assert.ok(confidence != undefined); + }); + it('check PointingInfo interface: confidence type', function() { + var gesttureInfo = person.gestureInfo; + var thePointingInfo = gesttureInfo.thePointingInfo; + var confidence = thePointingInfo.confidence; + assert.equal(typeof(confidence), 'number'); + }); + it('check PointingInfo interface: startTimeStamp exist', function() { + var gesttureInfo = person.gestureInfo; + var thePointingInfo = gesttureInfo.thePointingInfo; + var startTimeStamp = thePointingInfo.startTimeStamp; + assert.ok(startTimeStamp != undefined); + }); + it('check PointingInfo interface: startTimeStamp type', function() { + var gesttureInfo = person.gestureInfo; + var thePointingInfo = gesttureInfo.thePointingInfo; + var startTimeStamp = thePointingInfo.startTimeStamp; + assert.equal(typeof(startTimeStamp), 'number'); + }); +}); diff --git a/misc/nodeapi-realsense-tests/realsense-manual/test-poseeulerangles-interface.js b/misc/nodeapi-realsense-tests/realsense-manual/test-poseeulerangles-interface.js new file mode 100644 index 000000000..472234bf7 --- /dev/null +++ b/misc/nodeapi-realsense-tests/realsense-manual/test-poseeulerangles-interface.js @@ -0,0 +1,80 @@ +"use strict" +var emitter = require('events').EventEmitter; +const assert = require('assert'); +var module = require('bindings')('realsense_pt'); + +function inherits(target, source) { + for (var k in source.prototype) { + target.prototype[k] = source.prototype[k]; + } +} + +inherits(module.Instance, emitter); + +describe('check PersonTrackingResult', function(done){ + var PersonTrackingResult = null; + var persons = null; + var person =null; + + before(function(done){ + var instanceConfig = { + tracking: { + enable: true, + enableSegmentation: true, + enableHeadPose: true, + enableBlob: true, + enablePersonOrientation: true, + enableHeadBoundingBox: true, + enableFaceLandmarks: true, + enableDetectionFromFar: true, + maxTrackedPerson: 1, + detectMode: 'auto' + } + } + var instance = new module.Instance(instanceConfig); + instance.on('persontracked', function(result) { + PersonTrackingResult = result; + persons = PersonTrackingResult.persons; + person = persons[0]; + done(); + }); + instance.start().then(function(){console.log('Start camera')}); + this.timeout(10000); + }) + it('check PoseEulerAngles interface: yaw exist', function() { + var trackInfo = person.trackInfo; + var headPose = trackInfo.headPose; + var yaw = headPose.yaw; + assert.ok(yaw); + }); + it('check PoseEulerAngles interface: yaw type', function() { + var trackInfo = person.trackInfo; + var headPose = trackInfo.headPose; + var yaw = headPose.yaw; + assert.ok(typeof(yaw), 'number'); + }); + it('check PoseEulerAngles interface: pitch exist', function() { + var trackInfo = person.trackInfo; + var headPose = trackInfo.headPose; + var pitch = headPose.pitch; + assert.ok(pitch); + }); + it('check PoseEulerAngles interface: pitch type', function() { + var trackInfo = person.trackInfo; + var headPose = trackInfo.headPose; + var pitch = headPose.pitch; + assert.ok(typeof(pitch), 'number'); + }); + it('check PoseEulerAngles interface: roll exist', function() { + var trackInfo = person.trackInfo; + var headPose = trackInfo.headPose; + var roll = headPose.roll; + assert.ok(roll); + }); + it('check PoseEulerAngles interface: roll type', function() { + var trackInfo = person.trackInfo; + var headPose = trackInfo.headPose; + var roll = headPose.roll; + assert.equal(typeof(roll), 'number'); + }); +}); diff --git a/misc/nodeapi-realsense-tests/realsense-manual/test-skeletoninfo-interface.js b/misc/nodeapi-realsense-tests/realsense-manual/test-skeletoninfo-interface.js new file mode 100644 index 000000000..943592d33 --- /dev/null +++ b/misc/nodeapi-realsense-tests/realsense-manual/test-skeletoninfo-interface.js @@ -0,0 +1,45 @@ +"use strict" +var emitter = require('events').EventEmitter; +const assert = require('assert'); +var module = require('bindings')('realsense_pt'); + +function inherits(target, source) { + for (var k in source.prototype) { + target.prototype[k] = source.prototype[k]; + } +} + +inherits(module.Instance, emitter); + +describe('check PersonTrackingResult', function(done){ + var PersonTrackingResult = null; + var persons = null; + var person =null; + + before(function(done){ + var instanceConfig = { + skeleton: { + enable: true, + maxTrackedPerson: 1, + trackingArea: "upper-body" + } + } + var instance = new module.Instance(instanceConfig); + instance.on('persontracked', function(result) { + PersonTrackingResult = result; + persons = PersonTrackingResult.persons; + person = persons[0]; + done(); + }); + instance.start().then(function(){console.log('Start camera')}); + this.timeout(10000); + }) + it('check SkeletonInfo interface: skeletonJoints', function() { + var skeletonJoints = person.skeletonInfo.skeletonJoints; + var len = skeletonJoints.length; + assert.ok(skeletonJoints); + assert.ok(typeof(skeletonJoints) == 'object'); + assert.ok(len > 0); + }); +}); + diff --git a/misc/nodeapi-realsense-tests/realsense-manual/test-skeletonpointinfo-interface.js b/misc/nodeapi-realsense-tests/realsense-manual/test-skeletonpointinfo-interface.js new file mode 100644 index 000000000..99c18b7cc --- /dev/null +++ b/misc/nodeapi-realsense-tests/realsense-manual/test-skeletonpointinfo-interface.js @@ -0,0 +1,88 @@ +"use strict" +var emitter = require('events').EventEmitter; +const assert = require('assert'); +var module = require('bindings')('realsense_pt'); + +function inherits(target, source) { + for (var k in source.prototype) { + target.prototype[k] = source.prototype[k]; + } +} + +inherits(module.Instance, emitter); + +describe('check PersonTrackingResult', function(done){ + var PersonTrackingResult = null; + var persons = null; + var person =null; + + before(function(done){ + var instanceConfig = { + skeleton: { + enable: true, + maxTrackedPerson: 1, + trackingArea: "upper-body" + } + } + var instance = new module.Instance(instanceConfig); + instance.on('persontracked', function(result) { + PersonTrackingResult = result; + persons = PersonTrackingResult.persons; + person = persons[0]; + done(); + }); + instance.start().then(function(){console.log('Start camera')}); + this.timeout(10000); + }) + it('check SkeletonPointInfo interface: jointType exist', function() { + var skeletonJoints = person.skeletonJoints; + var SkeletonPointInfo = skeletonJoints[0]; + assert.ok(SkeletonPointInfo.jointType); + }); + it('check SkeletonPointInfo interface: jointType type', function() { + var skeletonJoints = person.skeletonJoints; + var SkeletonPointInfo = skeletonJoints[0]; + assert.equal(typeof(SkeletonPointInfo.jointType), 'object'); + }); + it('check SkeletonPointInfo interface: worldCoordinate exist', function() { + var skeletonJoints = person.skeletonJoints; + var SkeletonPointInfo = skeletonJoints[0]; + assert.ok(SkeletonPointInfo.worldCoordinate); + }); + it('check SkeletonPointInfo interface: worldCoordinate type', function() { + var skeletonJoints = person.skeletonJoints; + var SkeletonPointInfo = skeletonJoints[0]; + assert.equal(typeof(SkeletonPointInfo.worldCoordinate), 'object'); + }); + it('check SkeletonPointInfo interface: imageCoordinate exist', function() { + var skeletonJoints = person.skeletonJoints; + var SkeletonPointInfo = skeletonJoints[0]; + assert.ok(SkeletonPointInfo.imageCoordinate); + }); + it('check SkeletonPointInfo interface: imageCoordinate type', function() { + var skeletonJoints = person.skeletonJoints; + var SkeletonPointInfo = skeletonJoints[0]; + assert.equal(typeof(SkeletonPointInfo.imageCoordinate), 'object'); + }); + it('check SkeletonPointInfo interface: worldConfidence exist', function() { + var skeletonJoints = person.skeletonJoints; + var SkeletonPointInfo = skeletonJoints[0]; + assert.ok(SkeletonPointInfo.worldConfidence); + }); + it('check SkeletonPointInfo interface: worldConfidence type', function() { + var skeletonJoints = person.skeletonJoints; + var SkeletonPointInfo = skeletonJoints[0]; + assert.equal(typeof(SkeletonPointInfo.worldConfidence), 'number'); + }); + it('check SkeletonPointInfo interface: imageConfidence exist', function() { + var skeletonJoints = person.skeletonJoints; + var SkeletonPointInfo = skeletonJoints[0]; + assert.ok(SkeletonPointInfo.imageConfidence); + }); + it('check SkeletonPointInfo interface: imageConfidence type', function() { + var skeletonJoints = person.skeletonJoints; + var SkeletonPointInfo = skeletonJoints[0]; + assert.equal(typeof(SkeletonPointInfo.imageConfidence), 'number'); + }); +}); + diff --git a/misc/nodeapi-realsense-tests/realsense-manual/test-trackinginfo-interface.js b/misc/nodeapi-realsense-tests/realsense-manual/test-trackinginfo-interface.js new file mode 100644 index 000000000..4e3ac782d --- /dev/null +++ b/misc/nodeapi-realsense-tests/realsense-manual/test-trackinginfo-interface.js @@ -0,0 +1,125 @@ +"use strict" +var emitter = require('events').EventEmitter; +const assert = require('assert'); +var module = require('bindings')('realsense_pt'); + +function inherits(target, source) { + for (var k in source.prototype) { + target.prototype[k] = source.prototype[k]; + } +} + +inherits(module.Instance, emitter); + +describe('check PersonTrackingResult', function(done){ + var PersonTrackingResult = null; + var persons = null; + var person =null; + + before(function(done){ + var instanceConfig = { + tracking: { + enable: true, + enableSegmentation: true, + enableHeadPose: true, + enableBlob: true, + enablePersonOrientation: true, + enableHeadBoundingBox: true, + enableFaceLandmarks: true, + enableDetectionFromFar: true, + maxTrackedPerson: 1, + detectMode: 'auto' + } + } + var instance = new module.Instance(instanceConfig); + instance.on('persontracked', function(result) { + PersonTrackingResult = result; + persons = PersonTrackingResult.persons; + person = persons[0]; + done(); + }); + instance.start().then(function(){console.log('Start camera')}); + this.timeout(10000); + }) + it('check TrackingData interface: id exist', function() { + var trackInfo = person.trackInfo; + var id = trackInfo.id; + assert.ok(id != undefined); + }); + it('check TrackingData interface: id type', function() { + var trackInfo = person.trackInfo; + var id = trackInfo.id; + assert.equal(typeof(id), 'number'); + }); + it('check TrackingData interface: boundingBox exist', function() { + var trackInfo = person.trackInfo; + var boundingBox= trackInfo.boundingBox; + assert.ok(boundingBox != undefined); + }); + it('check TrackingData interface: boundingBox type', function() { + var trackInfo = person.trackInfo; + var boundingBox= trackInfo.boundingBox; + assert.equal(typeof(boundingBox), 'object'); + }); + it('check TrackingData interface: center exist', function() { + var trackInfo = person.trackInfo; + var center = trackInfo.center; + assert.ok(center != undefined); + }); + it('check TrackingData interface: center type', function() { + var trackInfo = person.trackInfo; + var center = trackInfo.center; + assert.equal(typeof(center), 'object'); + }); + it('check TrackingData interface: headBoundingBox exist', function() { + var trackInfo = person.trackInfo; + var headBoundingBox = trackInfo.headBoundingBox; + assert.ok(headBoundingBox != undefined); + }); + it('check TrackingData interface: headBoundingBox type', function() { + var trackInfo = person.trackInfo; + var headBoundingBox = trackInfo.headBoundingBox; + assert.equal(typeof(headBoundingBox), 'object'); + }); + it('check TrackingData interface: segmentationMask exist', function() { + var trackInfo = person.trackInfo; + var segmentationMask = trackInfo.segmentationMask; + assert.ok(segmentationMask != undefined); + }); + it('check TrackingData interface: segmentationMask type', function() { + var trackInfo = person.trackInfo; + var segmentationMask = trackInfo.segmentationMask; + assert.equal(typeof(segmentationMask), 'object'); + }); + it('check TrackingData interface: blobMask exist', function() { + var trackInfo = person.trackInfo; + var blobMask = trackInfo.blobMask; + assert.ok(blobMask != undefined); + }); + it('check TrackingData interface: blobMask type', function() { + var trackInfo = person.trackInfo; + var blobMask = trackInfo.blobMask; + assert.equal(typeof(blobMask), 'object'); + }); + it('check TrackingData interface: headPose exist', function() { + var trackInfo = person.trackInfo; + var headPose = trackInfo.headPose; + assert.ok(headPose != undefined); + }); + it('check TrackingData interface: headPose type', function() { + var trackInfo = person.trackInfo; + var headPose = trackInfo.headPose; + assert.equal(typeof(headPose), 'object'); + }); + it('check TrackingData interface: orient exist', function() { + var trackInfo = person.trackInfo; + var orient = trackInfo.orient; + assert.ok(orient != undefined); + }); + it('check TrackingData interface: orient type', function() { + var trackInfo = person.trackInfo; + var orient = trackInfo.orient; + assert.equal(typeof(orient), 'object'); + }); +}); + diff --git a/misc/nodeapi-realsense-tests/realsense-manual/test.js b/misc/nodeapi-realsense-tests/realsense-manual/test.js new file mode 100644 index 000000000..b6e96c7fb --- /dev/null +++ b/misc/nodeapi-realsense-tests/realsense-manual/test.js @@ -0,0 +1,36 @@ +"use strict" +var emitter = require('events').EventEmitter; +const assert = require('assert'); +var module = require('bindings')('realsense_pt'); + +function inherits(target, source) { + for (var k in source.prototype) { + target.prototype[k] = source.prototype[k]; + } +} + +inherits(module.Instance, emitter); + + var PersonTrackingResult = null; + var persons = null; + var person =null; + + var instanceConfig = { + skeleton: {enable: true, trackingArea: "upper-body"}, + tracking: {enable: true, enableSegmentation: true, enableFaceLandmarks: true, enableHeadPose: true, enableBlob: true, enablePersonOrientation: true, enableDetectionFromFar: true, detectMode: "auto"}, + lying: {enable: true}, + pose: {enable: true}, + face: {enable: true, policy: "standard", useMultiFrame: true}, + gesture: {enable: true}, + expression: {enable: true, enableAllExpressions: true} + } + var instance = new module.Instance(instanceConfig); + instance.on('persontracked', function(result) { + PersonTrackingResult = result; + persons = PersonTrackingResult.persons; + person = persons[0]; + console.log('-------'); + console.log(person); + console.log('-------'); + }); + instance.start().then(function(){console.log('Start camera')}); diff --git a/misc/nodeapi-realsense-tests/realsense-manual/test_common.js b/misc/nodeapi-realsense-tests/realsense-manual/test_common.js new file mode 100644 index 000000000..6658c402c --- /dev/null +++ b/misc/nodeapi-realsense-tests/realsense-manual/test_common.js @@ -0,0 +1,45 @@ +var instanceConfig = { +// skeleton: { +// enable: true, +// maxTrackedPerson: 2, +// trackArea: 'AREA_UPPER_BODY' +// }, + + tracking: { + enable: true + //enableHeadPose: true, + //enablePersonOrientation: true, + //enableHeadBoundingBox: true, + //enableFaceLandmarks: true + } + //expression: { + // enable: true, + // enableAllExpressions: true + //}, + //gesture: { + // enable: true, + // enableAllGestures: true + //}, + //recognition: { + // enable: true, + // policy: "standard", + // useMultiFrame: false + //} +}; +var emitter = require('events').EventEmitter; +var common = require('./common.js'); +var module = require('bindings')('pt'); +var m = common.getObj(module, 'Instance', instanceConfig); +function inherits(target, source) { + for (var k in source.prototype) { + target.prototype[k] = source.prototype[k]; + } +} +inherits(module.Instance, emitter); +//var m = new module.Instance(instanceConfig) +m.on('persontracked', function(result) { + result.persons.forEach(function(person) { + console.log('persion'); + }); +}); +m.start().then(function(){console.log('start');}); diff --git a/misc/nodeapi-realsense-tests/realsense/expressionRecognitionOptions/test-expressionRecognitionOptions-disableAllExpressions-false-positive.js b/misc/nodeapi-realsense-tests/realsense/expressionRecognitionOptions/test-expressionRecognitionOptions-disableAllExpressions-false-positive.js new file mode 100644 index 000000000..7ee572607 --- /dev/null +++ b/misc/nodeapi-realsense-tests/realsense/expressionRecognitionOptions/test-expressionRecognitionOptions-disableAllExpressions-false-positive.js @@ -0,0 +1,34 @@ +"use strict" +var emitter = require('events').EventEmitter; +const assert = require('assert'); +var module = require('bindings')('realsense_pt'); + +function inherits(target, source) { + for (var k in source.prototype) { + target.prototype[k] = source.prototype[k]; + } +} + +inherits(module.Instance, emitter); + +describe('check enum expressionRecogConfig', function(done){ + it('checking member of expressionRecognitionOptions: '+ "disableAllExpressions" + "false", function(done) { + this.timeout(60000); + var cfg = { + expression: { + + disableAllExpressions: false + + } + }; + var instance = new module.Instance(cfg); + instance.start().then(function(){ + console.log('Start camera'); + assert.ok(true); + done(); + }).catch(function(){ + assert.ok(false); + done(); + }); + }); +}); diff --git a/misc/nodeapi-realsense-tests/realsense/expressionRecognitionOptions/test-expressionRecognitionOptions-disableAllExpressions-true-positive.js b/misc/nodeapi-realsense-tests/realsense/expressionRecognitionOptions/test-expressionRecognitionOptions-disableAllExpressions-true-positive.js new file mode 100644 index 000000000..96a7c5e83 --- /dev/null +++ b/misc/nodeapi-realsense-tests/realsense/expressionRecognitionOptions/test-expressionRecognitionOptions-disableAllExpressions-true-positive.js @@ -0,0 +1,34 @@ +"use strict" +var emitter = require('events').EventEmitter; +const assert = require('assert'); +var module = require('bindings')('realsense_pt'); + +function inherits(target, source) { + for (var k in source.prototype) { + target.prototype[k] = source.prototype[k]; + } +} + +inherits(module.Instance, emitter); + +describe('check enum expressionRecogConfig', function(done){ + it('checking member of expressionRecognitionOptions: '+ "disableAllExpressions" + "true", function(done) { + this.timeout(60000); + var cfg = { + expression: { + + disableAllExpressions: true + + } + }; + var instance = new module.Instance(cfg); + instance.start().then(function(){ + console.log('Start camera'); + assert.ok(true); + done(); + }).catch(function(){ + assert.ok(false); + done(); + }); + }); +}); diff --git a/misc/nodeapi-realsense-tests/realsense/expressionRecognitionOptions/test-expressionRecognitionOptions-enable-false-positive.js b/misc/nodeapi-realsense-tests/realsense/expressionRecognitionOptions/test-expressionRecognitionOptions-enable-false-positive.js new file mode 100644 index 000000000..1c2e4f979 --- /dev/null +++ b/misc/nodeapi-realsense-tests/realsense/expressionRecognitionOptions/test-expressionRecognitionOptions-enable-false-positive.js @@ -0,0 +1,34 @@ +"use strict" +var emitter = require('events').EventEmitter; +const assert = require('assert'); +var module = require('bindings')('realsense_pt'); + +function inherits(target, source) { + for (var k in source.prototype) { + target.prototype[k] = source.prototype[k]; + } +} + +inherits(module.Instance, emitter); + +describe('check enum expressionRecogConfig', function(done){ + it('checking member of expressionRecognitionOptions: '+ "enable" + "false", function(done) { + this.timeout(60000); + var cfg = { + expression: { + + enable: false + + } + }; + var instance = new module.Instance(cfg); + instance.start().then(function(){ + console.log('Start camera'); + assert.ok(true); + done(); + }).catch(function(){ + assert.ok(false); + done(); + }); + }); +}); diff --git a/misc/nodeapi-realsense-tests/realsense/expressionRecognitionOptions/test-expressionRecognitionOptions-enable-true-positive.js b/misc/nodeapi-realsense-tests/realsense/expressionRecognitionOptions/test-expressionRecognitionOptions-enable-true-positive.js new file mode 100644 index 000000000..472ca84ab --- /dev/null +++ b/misc/nodeapi-realsense-tests/realsense/expressionRecognitionOptions/test-expressionRecognitionOptions-enable-true-positive.js @@ -0,0 +1,34 @@ +"use strict" +var emitter = require('events').EventEmitter; +const assert = require('assert'); +var module = require('bindings')('realsense_pt'); + +function inherits(target, source) { + for (var k in source.prototype) { + target.prototype[k] = source.prototype[k]; + } +} + +inherits(module.Instance, emitter); + +describe('check enum expressionRecogConfig', function(done){ + it('checking member of expressionRecognitionOptions: '+ "enable" + "true", function(done) { + this.timeout(60000); + var cfg = { + expression: { + + enable: true + + } + }; + var instance = new module.Instance(cfg); + instance.start().then(function(){ + console.log('Start camera'); + assert.ok(true); + done(); + }).catch(function(){ + assert.ok(false); + done(); + }); + }); +}); diff --git a/misc/nodeapi-realsense-tests/realsense/expressionRecognitionOptions/test-expressionRecognitionOptions-enableAllExpressions-false-positive.js b/misc/nodeapi-realsense-tests/realsense/expressionRecognitionOptions/test-expressionRecognitionOptions-enableAllExpressions-false-positive.js new file mode 100644 index 000000000..18d0e3c4f --- /dev/null +++ b/misc/nodeapi-realsense-tests/realsense/expressionRecognitionOptions/test-expressionRecognitionOptions-enableAllExpressions-false-positive.js @@ -0,0 +1,34 @@ +"use strict" +var emitter = require('events').EventEmitter; +const assert = require('assert'); +var module = require('bindings')('realsense_pt'); + +function inherits(target, source) { + for (var k in source.prototype) { + target.prototype[k] = source.prototype[k]; + } +} + +inherits(module.Instance, emitter); + +describe('check enum expressionRecogConfig', function(done){ + it('checking member of expressionRecognitionOptions: '+ "enableAllExpressions" + "false", function(done) { + this.timeout(60000); + var cfg = { + expression: { + + enableAllExpressions: false + + } + }; + var instance = new module.Instance(cfg); + instance.start().then(function(){ + console.log('Start camera'); + assert.ok(true); + done(); + }).catch(function(){ + assert.ok(false); + done(); + }); + }); +}); diff --git a/misc/nodeapi-realsense-tests/realsense/expressionRecognitionOptions/test-expressionRecognitionOptions-enableAllExpressions-true-positive.js b/misc/nodeapi-realsense-tests/realsense/expressionRecognitionOptions/test-expressionRecognitionOptions-enableAllExpressions-true-positive.js new file mode 100644 index 000000000..1bbd63f4f --- /dev/null +++ b/misc/nodeapi-realsense-tests/realsense/expressionRecognitionOptions/test-expressionRecognitionOptions-enableAllExpressions-true-positive.js @@ -0,0 +1,34 @@ +"use strict" +var emitter = require('events').EventEmitter; +const assert = require('assert'); +var module = require('bindings')('realsense_pt'); + +function inherits(target, source) { + for (var k in source.prototype) { + target.prototype[k] = source.prototype[k]; + } +} + +inherits(module.Instance, emitter); + +describe('check enum expressionRecogConfig', function(done){ + it('checking member of expressionRecognitionOptions: '+ "enableAllExpressions" + "true", function(done) { + this.timeout(60000); + var cfg = { + expression: { + + enableAllExpressions: true + + } + }; + var instance = new module.Instance(cfg); + instance.start().then(function(){ + console.log('Start camera'); + assert.ok(true); + done(); + }).catch(function(){ + assert.ok(false); + done(); + }); + }); +}); diff --git a/misc/nodeapi-realsense-tests/realsense/expressionRecognitionOptions/test-expressionRecognitionOptions-enableAnger-false-positive.js b/misc/nodeapi-realsense-tests/realsense/expressionRecognitionOptions/test-expressionRecognitionOptions-enableAnger-false-positive.js new file mode 100644 index 000000000..e2c4e3b69 --- /dev/null +++ b/misc/nodeapi-realsense-tests/realsense/expressionRecognitionOptions/test-expressionRecognitionOptions-enableAnger-false-positive.js @@ -0,0 +1,34 @@ +"use strict" +var emitter = require('events').EventEmitter; +const assert = require('assert'); +var module = require('bindings')('realsense_pt'); + +function inherits(target, source) { + for (var k in source.prototype) { + target.prototype[k] = source.prototype[k]; + } +} + +inherits(module.Instance, emitter); + +describe('check enum expressionRecogConfig', function(done){ + it('checking member of expressionRecognitionOptions: '+ "enableAnger" + "false", function(done) { + this.timeout(60000); + var cfg = { + expression: { + + enableAnger: false + + } + }; + var instance = new module.Instance(cfg); + instance.start().then(function(){ + console.log('Start camera'); + assert.ok(true); + done(); + }).catch(function(){ + assert.ok(false); + done(); + }); + }); +}); diff --git a/misc/nodeapi-realsense-tests/realsense/expressionRecognitionOptions/test-expressionRecognitionOptions-enableAnger-true-positive.js b/misc/nodeapi-realsense-tests/realsense/expressionRecognitionOptions/test-expressionRecognitionOptions-enableAnger-true-positive.js new file mode 100644 index 000000000..e44d630bb --- /dev/null +++ b/misc/nodeapi-realsense-tests/realsense/expressionRecognitionOptions/test-expressionRecognitionOptions-enableAnger-true-positive.js @@ -0,0 +1,34 @@ +"use strict" +var emitter = require('events').EventEmitter; +const assert = require('assert'); +var module = require('bindings')('realsense_pt'); + +function inherits(target, source) { + for (var k in source.prototype) { + target.prototype[k] = source.prototype[k]; + } +} + +inherits(module.Instance, emitter); + +describe('check enum expressionRecogConfig', function(done){ + it('checking member of expressionRecognitionOptions: '+ "enableAnger" + "true", function(done) { + this.timeout(60000); + var cfg = { + expression: { + + enableAnger: true + + } + }; + var instance = new module.Instance(cfg); + instance.start().then(function(){ + console.log('Start camera'); + assert.ok(true); + done(); + }).catch(function(){ + assert.ok(false); + done(); + }); + }); +}); diff --git a/misc/nodeapi-realsense-tests/realsense/expressionRecognitionOptions/test-expressionRecognitionOptions-enableContempt-false-positive.js b/misc/nodeapi-realsense-tests/realsense/expressionRecognitionOptions/test-expressionRecognitionOptions-enableContempt-false-positive.js new file mode 100644 index 000000000..24ea285a4 --- /dev/null +++ b/misc/nodeapi-realsense-tests/realsense/expressionRecognitionOptions/test-expressionRecognitionOptions-enableContempt-false-positive.js @@ -0,0 +1,34 @@ +"use strict" +var emitter = require('events').EventEmitter; +const assert = require('assert'); +var module = require('bindings')('realsense_pt'); + +function inherits(target, source) { + for (var k in source.prototype) { + target.prototype[k] = source.prototype[k]; + } +} + +inherits(module.Instance, emitter); + +describe('check enum expressionRecogConfig', function(done){ + it('checking member of expressionRecognitionOptions: '+ "enableContempt" + "false", function(done) { + this.timeout(60000); + var cfg = { + expression: { + + enableContempt: false + + } + }; + var instance = new module.Instance(cfg); + instance.start().then(function(){ + console.log('Start camera'); + assert.ok(true); + done(); + }).catch(function(){ + assert.ok(false); + done(); + }); + }); +}); diff --git a/misc/nodeapi-realsense-tests/realsense/expressionRecognitionOptions/test-expressionRecognitionOptions-enableContempt-true-positive.js b/misc/nodeapi-realsense-tests/realsense/expressionRecognitionOptions/test-expressionRecognitionOptions-enableContempt-true-positive.js new file mode 100644 index 000000000..8aadb791a --- /dev/null +++ b/misc/nodeapi-realsense-tests/realsense/expressionRecognitionOptions/test-expressionRecognitionOptions-enableContempt-true-positive.js @@ -0,0 +1,34 @@ +"use strict" +var emitter = require('events').EventEmitter; +const assert = require('assert'); +var module = require('bindings')('realsense_pt'); + +function inherits(target, source) { + for (var k in source.prototype) { + target.prototype[k] = source.prototype[k]; + } +} + +inherits(module.Instance, emitter); + +describe('check enum expressionRecogConfig', function(done){ + it('checking member of expressionRecognitionOptions: '+ "enableContempt" + "true", function(done) { + this.timeout(60000); + var cfg = { + expression: { + + enableContempt: true + + } + }; + var instance = new module.Instance(cfg); + instance.start().then(function(){ + console.log('Start camera'); + assert.ok(true); + done(); + }).catch(function(){ + assert.ok(false); + done(); + }); + }); +}); diff --git a/misc/nodeapi-realsense-tests/realsense/expressionRecognitionOptions/test-expressionRecognitionOptions-enableDisgust-false-positive.js b/misc/nodeapi-realsense-tests/realsense/expressionRecognitionOptions/test-expressionRecognitionOptions-enableDisgust-false-positive.js new file mode 100644 index 000000000..b05fe6da4 --- /dev/null +++ b/misc/nodeapi-realsense-tests/realsense/expressionRecognitionOptions/test-expressionRecognitionOptions-enableDisgust-false-positive.js @@ -0,0 +1,34 @@ +"use strict" +var emitter = require('events').EventEmitter; +const assert = require('assert'); +var module = require('bindings')('realsense_pt'); + +function inherits(target, source) { + for (var k in source.prototype) { + target.prototype[k] = source.prototype[k]; + } +} + +inherits(module.Instance, emitter); + +describe('check enum expressionRecogConfig', function(done){ + it('checking member of expressionRecognitionOptions: '+ "enableDisgust" + "false", function(done) { + this.timeout(60000); + var cfg = { + expression: { + + enableDisgust: false + + } + }; + var instance = new module.Instance(cfg); + instance.start().then(function(){ + console.log('Start camera'); + assert.ok(true); + done(); + }).catch(function(){ + assert.ok(false); + done(); + }); + }); +}); diff --git a/misc/nodeapi-realsense-tests/realsense/expressionRecognitionOptions/test-expressionRecognitionOptions-enableDisgust-true-positive.js b/misc/nodeapi-realsense-tests/realsense/expressionRecognitionOptions/test-expressionRecognitionOptions-enableDisgust-true-positive.js new file mode 100644 index 000000000..29dc13e73 --- /dev/null +++ b/misc/nodeapi-realsense-tests/realsense/expressionRecognitionOptions/test-expressionRecognitionOptions-enableDisgust-true-positive.js @@ -0,0 +1,34 @@ +"use strict" +var emitter = require('events').EventEmitter; +const assert = require('assert'); +var module = require('bindings')('realsense_pt'); + +function inherits(target, source) { + for (var k in source.prototype) { + target.prototype[k] = source.prototype[k]; + } +} + +inherits(module.Instance, emitter); + +describe('check enum expressionRecogConfig', function(done){ + it('checking member of expressionRecognitionOptions: '+ "enableDisgust" + "true", function(done) { + this.timeout(60000); + var cfg = { + expression: { + + enableDisgust: true + + } + }; + var instance = new module.Instance(cfg); + instance.start().then(function(){ + console.log('Start camera'); + assert.ok(true); + done(); + }).catch(function(){ + assert.ok(false); + done(); + }); + }); +}); diff --git a/misc/nodeapi-realsense-tests/realsense/expressionRecognitionOptions/test-expressionRecognitionOptions-enableFear-false-positive.js b/misc/nodeapi-realsense-tests/realsense/expressionRecognitionOptions/test-expressionRecognitionOptions-enableFear-false-positive.js new file mode 100644 index 000000000..f00de040b --- /dev/null +++ b/misc/nodeapi-realsense-tests/realsense/expressionRecognitionOptions/test-expressionRecognitionOptions-enableFear-false-positive.js @@ -0,0 +1,34 @@ +"use strict" +var emitter = require('events').EventEmitter; +const assert = require('assert'); +var module = require('bindings')('realsense_pt'); + +function inherits(target, source) { + for (var k in source.prototype) { + target.prototype[k] = source.prototype[k]; + } +} + +inherits(module.Instance, emitter); + +describe('check enum expressionRecogConfig', function(done){ + it('checking member of expressionRecognitionOptions: '+ "enableFear" + "false", function(done) { + this.timeout(60000); + var cfg = { + expression: { + + enableFear: false + + } + }; + var instance = new module.Instance(cfg); + instance.start().then(function(){ + console.log('Start camera'); + assert.ok(true); + done(); + }).catch(function(){ + assert.ok(false); + done(); + }); + }); +}); diff --git a/misc/nodeapi-realsense-tests/realsense/expressionRecognitionOptions/test-expressionRecognitionOptions-enableFear-true-positive.js b/misc/nodeapi-realsense-tests/realsense/expressionRecognitionOptions/test-expressionRecognitionOptions-enableFear-true-positive.js new file mode 100644 index 000000000..79a735aff --- /dev/null +++ b/misc/nodeapi-realsense-tests/realsense/expressionRecognitionOptions/test-expressionRecognitionOptions-enableFear-true-positive.js @@ -0,0 +1,34 @@ +"use strict" +var emitter = require('events').EventEmitter; +const assert = require('assert'); +var module = require('bindings')('realsense_pt'); + +function inherits(target, source) { + for (var k in source.prototype) { + target.prototype[k] = source.prototype[k]; + } +} + +inherits(module.Instance, emitter); + +describe('check enum expressionRecogConfig', function(done){ + it('checking member of expressionRecognitionOptions: '+ "enableFear" + "true", function(done) { + this.timeout(60000); + var cfg = { + expression: { + + enableFear: true + + } + }; + var instance = new module.Instance(cfg); + instance.start().then(function(){ + console.log('Start camera'); + assert.ok(true); + done(); + }).catch(function(){ + assert.ok(false); + done(); + }); + }); +}); diff --git a/misc/nodeapi-realsense-tests/realsense/expressionRecognitionOptions/test-expressionRecognitionOptions-enableHappy-false-positive.js b/misc/nodeapi-realsense-tests/realsense/expressionRecognitionOptions/test-expressionRecognitionOptions-enableHappy-false-positive.js new file mode 100644 index 000000000..3e69d7238 --- /dev/null +++ b/misc/nodeapi-realsense-tests/realsense/expressionRecognitionOptions/test-expressionRecognitionOptions-enableHappy-false-positive.js @@ -0,0 +1,34 @@ +"use strict" +var emitter = require('events').EventEmitter; +const assert = require('assert'); +var module = require('bindings')('realsense_pt'); + +function inherits(target, source) { + for (var k in source.prototype) { + target.prototype[k] = source.prototype[k]; + } +} + +inherits(module.Instance, emitter); + +describe('check enum expressionRecogConfig', function(done){ + it('checking member of expressionRecognitionOptions: '+ "enableHappy" + "false", function(done) { + this.timeout(60000); + var cfg = { + expression: { + + enableHappy: false + + } + }; + var instance = new module.Instance(cfg); + instance.start().then(function(){ + console.log('Start camera'); + assert.ok(true); + done(); + }).catch(function(){ + assert.ok(false); + done(); + }); + }); +}); diff --git a/misc/nodeapi-realsense-tests/realsense/expressionRecognitionOptions/test-expressionRecognitionOptions-enableHappy-true-positive.js b/misc/nodeapi-realsense-tests/realsense/expressionRecognitionOptions/test-expressionRecognitionOptions-enableHappy-true-positive.js new file mode 100644 index 000000000..036871b04 --- /dev/null +++ b/misc/nodeapi-realsense-tests/realsense/expressionRecognitionOptions/test-expressionRecognitionOptions-enableHappy-true-positive.js @@ -0,0 +1,34 @@ +"use strict" +var emitter = require('events').EventEmitter; +const assert = require('assert'); +var module = require('bindings')('realsense_pt'); + +function inherits(target, source) { + for (var k in source.prototype) { + target.prototype[k] = source.prototype[k]; + } +} + +inherits(module.Instance, emitter); + +describe('check enum expressionRecogConfig', function(done){ + it('checking member of expressionRecognitionOptions: '+ "enableHappy" + "true", function(done) { + this.timeout(60000); + var cfg = { + expression: { + + enableHappy: true + + } + }; + var instance = new module.Instance(cfg); + instance.start().then(function(){ + console.log('Start camera'); + assert.ok(true); + done(); + }).catch(function(){ + assert.ok(false); + done(); + }); + }); +}); diff --git a/misc/nodeapi-realsense-tests/realsense/expressionRecognitionOptions/test-expressionRecognitionOptions-enableNeutral-false-positive.js b/misc/nodeapi-realsense-tests/realsense/expressionRecognitionOptions/test-expressionRecognitionOptions-enableNeutral-false-positive.js new file mode 100644 index 000000000..d03fb9817 --- /dev/null +++ b/misc/nodeapi-realsense-tests/realsense/expressionRecognitionOptions/test-expressionRecognitionOptions-enableNeutral-false-positive.js @@ -0,0 +1,34 @@ +"use strict" +var emitter = require('events').EventEmitter; +const assert = require('assert'); +var module = require('bindings')('realsense_pt'); + +function inherits(target, source) { + for (var k in source.prototype) { + target.prototype[k] = source.prototype[k]; + } +} + +inherits(module.Instance, emitter); + +describe('check enum expressionRecogConfig', function(done){ + it('checking member of expressionRecognitionOptions: '+ "enableNeutral" + "false", function(done) { + this.timeout(60000); + var cfg = { + expression: { + + enableNeutral: false + + } + }; + var instance = new module.Instance(cfg); + instance.start().then(function(){ + console.log('Start camera'); + assert.ok(true); + done(); + }).catch(function(){ + assert.ok(false); + done(); + }); + }); +}); diff --git a/misc/nodeapi-realsense-tests/realsense/expressionRecognitionOptions/test-expressionRecognitionOptions-enableNeutral-true-positive.js b/misc/nodeapi-realsense-tests/realsense/expressionRecognitionOptions/test-expressionRecognitionOptions-enableNeutral-true-positive.js new file mode 100644 index 000000000..2558a44b0 --- /dev/null +++ b/misc/nodeapi-realsense-tests/realsense/expressionRecognitionOptions/test-expressionRecognitionOptions-enableNeutral-true-positive.js @@ -0,0 +1,34 @@ +"use strict" +var emitter = require('events').EventEmitter; +const assert = require('assert'); +var module = require('bindings')('realsense_pt'); + +function inherits(target, source) { + for (var k in source.prototype) { + target.prototype[k] = source.prototype[k]; + } +} + +inherits(module.Instance, emitter); + +describe('check enum expressionRecogConfig', function(done){ + it('checking member of expressionRecognitionOptions: '+ "enableNeutral" + "true", function(done) { + this.timeout(60000); + var cfg = { + expression: { + + enableNeutral: true + + } + }; + var instance = new module.Instance(cfg); + instance.start().then(function(){ + console.log('Start camera'); + assert.ok(true); + done(); + }).catch(function(){ + assert.ok(false); + done(); + }); + }); +}); diff --git a/misc/nodeapi-realsense-tests/realsense/expressionRecognitionOptions/test-expressionRecognitionOptions-enableSad-false-positive.js b/misc/nodeapi-realsense-tests/realsense/expressionRecognitionOptions/test-expressionRecognitionOptions-enableSad-false-positive.js new file mode 100644 index 000000000..60932f1be --- /dev/null +++ b/misc/nodeapi-realsense-tests/realsense/expressionRecognitionOptions/test-expressionRecognitionOptions-enableSad-false-positive.js @@ -0,0 +1,34 @@ +"use strict" +var emitter = require('events').EventEmitter; +const assert = require('assert'); +var module = require('bindings')('realsense_pt'); + +function inherits(target, source) { + for (var k in source.prototype) { + target.prototype[k] = source.prototype[k]; + } +} + +inherits(module.Instance, emitter); + +describe('check enum expressionRecogConfig', function(done){ + it('checking member of expressionRecognitionOptions: '+ "enableSad" + "false", function(done) { + this.timeout(60000); + var cfg = { + expression: { + + enableSad: false + + } + }; + var instance = new module.Instance(cfg); + instance.start().then(function(){ + console.log('Start camera'); + assert.ok(true); + done(); + }).catch(function(){ + assert.ok(false); + done(); + }); + }); +}); diff --git a/misc/nodeapi-realsense-tests/realsense/expressionRecognitionOptions/test-expressionRecognitionOptions-enableSad-true-positive.js b/misc/nodeapi-realsense-tests/realsense/expressionRecognitionOptions/test-expressionRecognitionOptions-enableSad-true-positive.js new file mode 100644 index 000000000..3ab031c30 --- /dev/null +++ b/misc/nodeapi-realsense-tests/realsense/expressionRecognitionOptions/test-expressionRecognitionOptions-enableSad-true-positive.js @@ -0,0 +1,34 @@ +"use strict" +var emitter = require('events').EventEmitter; +const assert = require('assert'); +var module = require('bindings')('realsense_pt'); + +function inherits(target, source) { + for (var k in source.prototype) { + target.prototype[k] = source.prototype[k]; + } +} + +inherits(module.Instance, emitter); + +describe('check enum expressionRecogConfig', function(done){ + it('checking member of expressionRecognitionOptions: '+ "enableSad" + "true", function(done) { + this.timeout(60000); + var cfg = { + expression: { + + enableSad: true + + } + }; + var instance = new module.Instance(cfg); + instance.start().then(function(){ + console.log('Start camera'); + assert.ok(true); + done(); + }).catch(function(){ + assert.ok(false); + done(); + }); + }); +}); diff --git a/misc/nodeapi-realsense-tests/realsense/expressionRecognitionOptions/test-expressionRecognitionOptions-enableSurprise-false-positive.js b/misc/nodeapi-realsense-tests/realsense/expressionRecognitionOptions/test-expressionRecognitionOptions-enableSurprise-false-positive.js new file mode 100644 index 000000000..f9d4ad5f4 --- /dev/null +++ b/misc/nodeapi-realsense-tests/realsense/expressionRecognitionOptions/test-expressionRecognitionOptions-enableSurprise-false-positive.js @@ -0,0 +1,34 @@ +"use strict" +var emitter = require('events').EventEmitter; +const assert = require('assert'); +var module = require('bindings')('realsense_pt'); + +function inherits(target, source) { + for (var k in source.prototype) { + target.prototype[k] = source.prototype[k]; + } +} + +inherits(module.Instance, emitter); + +describe('check enum expressionRecogConfig', function(done){ + it('checking member of expressionRecognitionOptions: '+ "enableSurprise" + "false", function(done) { + this.timeout(60000); + var cfg = { + expression: { + + enableSurprise: false + + } + }; + var instance = new module.Instance(cfg); + instance.start().then(function(){ + console.log('Start camera'); + assert.ok(true); + done(); + }).catch(function(){ + assert.ok(false); + done(); + }); + }); +}); diff --git a/misc/nodeapi-realsense-tests/realsense/expressionRecognitionOptions/test-expressionRecognitionOptions-enableSurprise-true-positive.js b/misc/nodeapi-realsense-tests/realsense/expressionRecognitionOptions/test-expressionRecognitionOptions-enableSurprise-true-positive.js new file mode 100644 index 000000000..a31929abf --- /dev/null +++ b/misc/nodeapi-realsense-tests/realsense/expressionRecognitionOptions/test-expressionRecognitionOptions-enableSurprise-true-positive.js @@ -0,0 +1,34 @@ +"use strict" +var emitter = require('events').EventEmitter; +const assert = require('assert'); +var module = require('bindings')('realsense_pt'); + +function inherits(target, source) { + for (var k in source.prototype) { + target.prototype[k] = source.prototype[k]; + } +} + +inherits(module.Instance, emitter); + +describe('check enum expressionRecogConfig', function(done){ + it('checking member of expressionRecognitionOptions: '+ "enableSurprise" + "true", function(done) { + this.timeout(60000); + var cfg = { + expression: { + + enableSurprise: true + + } + }; + var instance = new module.Instance(cfg); + instance.start().then(function(){ + console.log('Start camera'); + assert.ok(true); + done(); + }).catch(function(){ + assert.ok(false); + done(); + }); + }); +}); diff --git a/misc/nodeapi-realsense-tests/realsense/expressionRecognitionOptions/test-expressionRecognitionOptions-maxTrackedPerson-1-positive.js b/misc/nodeapi-realsense-tests/realsense/expressionRecognitionOptions/test-expressionRecognitionOptions-maxTrackedPerson-1-positive.js new file mode 100644 index 000000000..ad1274d8d --- /dev/null +++ b/misc/nodeapi-realsense-tests/realsense/expressionRecognitionOptions/test-expressionRecognitionOptions-maxTrackedPerson-1-positive.js @@ -0,0 +1,34 @@ +"use strict" +var emitter = require('events').EventEmitter; +const assert = require('assert'); +var module = require('bindings')('realsense_pt'); + +function inherits(target, source) { + for (var k in source.prototype) { + target.prototype[k] = source.prototype[k]; + } +} + +inherits(module.Instance, emitter); + +describe('check enum expressionRecogConfig', function(done){ + it('checking member of expressionRecognitionOptions: '+ "maxTrackedPerson" + "1", function(done) { + this.timeout(60000); + var cfg = { + expression: { + + maxTrackedPerson: 1 + + } + }; + var instance = new module.Instance(cfg); + instance.start().then(function(){ + console.log('Start camera'); + assert.ok(true); + done(); + }).catch(function(){ + assert.ok(false); + done(); + }); + }); +}); diff --git a/misc/nodeapi-realsense-tests/realsense/expressionRecognitionOptions/test-expressionRecognitionOptions-maxTrackedPerson-2-positive.js b/misc/nodeapi-realsense-tests/realsense/expressionRecognitionOptions/test-expressionRecognitionOptions-maxTrackedPerson-2-positive.js new file mode 100644 index 000000000..14af64b49 --- /dev/null +++ b/misc/nodeapi-realsense-tests/realsense/expressionRecognitionOptions/test-expressionRecognitionOptions-maxTrackedPerson-2-positive.js @@ -0,0 +1,34 @@ +"use strict" +var emitter = require('events').EventEmitter; +const assert = require('assert'); +var module = require('bindings')('realsense_pt'); + +function inherits(target, source) { + for (var k in source.prototype) { + target.prototype[k] = source.prototype[k]; + } +} + +inherits(module.Instance, emitter); + +describe('check enum expressionRecogConfig', function(done){ + it('checking member of expressionRecognitionOptions: '+ "maxTrackedPerson" + "2", function(done) { + this.timeout(60000); + var cfg = { + expression: { + + maxTrackedPerson: 2 + + } + }; + var instance = new module.Instance(cfg); + instance.start().then(function(){ + console.log('Start camera'); + assert.ok(true); + done(); + }).catch(function(){ + assert.ok(false); + done(); + }); + }); +}); diff --git a/misc/nodeapi-realsense-tests/realsense/faceRecognitionOptions/test-faceRecognitionOptions-enable-false-positive.js b/misc/nodeapi-realsense-tests/realsense/faceRecognitionOptions/test-faceRecognitionOptions-enable-false-positive.js new file mode 100644 index 000000000..594b27d28 --- /dev/null +++ b/misc/nodeapi-realsense-tests/realsense/faceRecognitionOptions/test-faceRecognitionOptions-enable-false-positive.js @@ -0,0 +1,34 @@ +"use strict" +var emitter = require('events').EventEmitter; +const assert = require('assert'); +var module = require('bindings')('realsense_pt'); + +function inherits(target, source) { + for (var k in source.prototype) { + target.prototype[k] = source.prototype[k]; + } +} + +inherits(module.Instance, emitter); + +describe('check enum FaceRecognitionOptions', function(done){ + it('checking member of FaceRecognitionOptions: '+ "enable" + "false", function(done) { + this.timeout(60000); + var cfg = { + face: { + + enable: false + + } + }; + var instance = new module.Instance(cfg); + instance.start().then(function(){ + console.log('Start camera'); + assert.ok(true); + done(); + }).catch(function(){ + assert.ok(false); + done(); + }); + }); +}); diff --git a/misc/nodeapi-realsense-tests/realsense/faceRecognitionOptions/test-faceRecognitionOptions-enable-true-positive.js b/misc/nodeapi-realsense-tests/realsense/faceRecognitionOptions/test-faceRecognitionOptions-enable-true-positive.js new file mode 100644 index 000000000..e43b89aa6 --- /dev/null +++ b/misc/nodeapi-realsense-tests/realsense/faceRecognitionOptions/test-faceRecognitionOptions-enable-true-positive.js @@ -0,0 +1,34 @@ +"use strict" +var emitter = require('events').EventEmitter; +const assert = require('assert'); +var module = require('bindings')('realsense_pt'); + +function inherits(target, source) { + for (var k in source.prototype) { + target.prototype[k] = source.prototype[k]; + } +} + +inherits(module.Instance, emitter); + +describe('check enum FaceRecognitionOptions', function(done){ + it('checking member of FaceRecognitionOptions: '+ "enable" + "true", function(done) { + this.timeout(60000); + var cfg = { + face: { + + enable: true + + } + }; + var instance = new module.Instance(cfg); + instance.start().then(function(){ + console.log('Start camera'); + assert.ok(true); + done(); + }).catch(function(){ + assert.ok(false); + done(); + }); + }); +}); diff --git a/misc/nodeapi-realsense-tests/realsense/faceRecognitionOptions/test-faceRecognitionOptions-policy-standard-positive.js b/misc/nodeapi-realsense-tests/realsense/faceRecognitionOptions/test-faceRecognitionOptions-policy-standard-positive.js new file mode 100644 index 000000000..9443fb582 --- /dev/null +++ b/misc/nodeapi-realsense-tests/realsense/faceRecognitionOptions/test-faceRecognitionOptions-policy-standard-positive.js @@ -0,0 +1,34 @@ +"use strict" +var emitter = require('events').EventEmitter; +const assert = require('assert'); +var module = require('bindings')('realsense_pt'); + +function inherits(target, source) { + for (var k in source.prototype) { + target.prototype[k] = source.prototype[k]; + } +} + +inherits(module.Instance, emitter); + +describe('check enum FaceRecognitionOptions', function(done){ + it('checking member of FaceRecognitionOptions: '+ "policy" + "standard", function(done) { + this.timeout(60000); + var cfg = { + face: { + + policy: 'standard' + + } + }; + var instance = new module.Instance(cfg); + instance.start().then(function(){ + console.log('Start camera'); + assert.ok(true); + done(); + }).catch(function(){ + assert.ok(false); + done(); + }); + }); +}); diff --git a/misc/nodeapi-realsense-tests/realsense/faceRecognitionOptions/test-faceRecognitionOptions-useMultiFrame-false-positive.js b/misc/nodeapi-realsense-tests/realsense/faceRecognitionOptions/test-faceRecognitionOptions-useMultiFrame-false-positive.js new file mode 100644 index 000000000..f0d742f19 --- /dev/null +++ b/misc/nodeapi-realsense-tests/realsense/faceRecognitionOptions/test-faceRecognitionOptions-useMultiFrame-false-positive.js @@ -0,0 +1,34 @@ +"use strict" +var emitter = require('events').EventEmitter; +const assert = require('assert'); +var module = require('bindings')('realsense_pt'); + +function inherits(target, source) { + for (var k in source.prototype) { + target.prototype[k] = source.prototype[k]; + } +} + +inherits(module.Instance, emitter); + +describe('check enum FaceRecognitionOptions', function(done){ + it('checking member of FaceRecognitionOptions: '+ "useMultiFrame" + "false", function(done) { + this.timeout(60000); + var cfg = { + face: { + + useMultiFrame: false + + } + }; + var instance = new module.Instance(cfg); + instance.start().then(function(){ + console.log('Start camera'); + assert.ok(true); + done(); + }).catch(function(){ + assert.ok(false); + done(); + }); + }); +}); diff --git a/misc/nodeapi-realsense-tests/realsense/faceRecognitionOptions/test-faceRecognitionOptions-useMultiFrame-true-positive.js b/misc/nodeapi-realsense-tests/realsense/faceRecognitionOptions/test-faceRecognitionOptions-useMultiFrame-true-positive.js new file mode 100644 index 000000000..103034bc0 --- /dev/null +++ b/misc/nodeapi-realsense-tests/realsense/faceRecognitionOptions/test-faceRecognitionOptions-useMultiFrame-true-positive.js @@ -0,0 +1,34 @@ +"use strict" +var emitter = require('events').EventEmitter; +const assert = require('assert'); +var module = require('bindings')('realsense_pt'); + +function inherits(target, source) { + for (var k in source.prototype) { + target.prototype[k] = source.prototype[k]; + } +} + +inherits(module.Instance, emitter); + +describe('check enum FaceRecognitionOptions', function(done){ + it('checking member of FaceRecognitionOptions: '+ "useMultiFrame" + "true", function(done) { + this.timeout(60000); + var cfg = { + face: { + + useMultiFrame: true + + } + }; + var instance = new module.Instance(cfg); + instance.start().then(function(){ + console.log('Start camera'); + assert.ok(true); + done(); + }).catch(function(){ + assert.ok(false); + done(); + }); + }); +}); diff --git a/misc/nodeapi-realsense-tests/realsense/gestureRecognitionOptions/test-gestureRecognitionOptions-disableAllGestures-false-positive.js b/misc/nodeapi-realsense-tests/realsense/gestureRecognitionOptions/test-gestureRecognitionOptions-disableAllGestures-false-positive.js new file mode 100644 index 000000000..05b765e8a --- /dev/null +++ b/misc/nodeapi-realsense-tests/realsense/gestureRecognitionOptions/test-gestureRecognitionOptions-disableAllGestures-false-positive.js @@ -0,0 +1,34 @@ +"use strict" +var emitter = require('events').EventEmitter; +const assert = require('assert'); +var module = require('bindings')('realsense_pt'); + +function inherits(target, source) { + for (var k in source.prototype) { + target.prototype[k] = source.prototype[k]; + } +} + +inherits(module.Instance, emitter); + +describe('check enum GestureRecognitionOptions', function(done){ + it('checking member of GestureRecognitionOptions: '+ "disableAllGestures" + "false", function(done) { + this.timeout(60000); + var cfg = { + gesture: { + + disableAllGestures: false + + } + }; + var instance = new module.Instance(cfg); + instance.start().then(function(){ + console.log('Start camera'); + assert.ok(true); + done(); + }).catch(function(){ + assert.ok(false); + done(); + }); + }); +}); diff --git a/misc/nodeapi-realsense-tests/realsense/gestureRecognitionOptions/test-gestureRecognitionOptions-disableAllGestures-true-positive.js b/misc/nodeapi-realsense-tests/realsense/gestureRecognitionOptions/test-gestureRecognitionOptions-disableAllGestures-true-positive.js new file mode 100644 index 000000000..81fc5ff51 --- /dev/null +++ b/misc/nodeapi-realsense-tests/realsense/gestureRecognitionOptions/test-gestureRecognitionOptions-disableAllGestures-true-positive.js @@ -0,0 +1,34 @@ +"use strict" +var emitter = require('events').EventEmitter; +const assert = require('assert'); +var module = require('bindings')('realsense_pt'); + +function inherits(target, source) { + for (var k in source.prototype) { + target.prototype[k] = source.prototype[k]; + } +} + +inherits(module.Instance, emitter); + +describe('check enum GestureRecognitionOptions', function(done){ + it('checking member of GestureRecognitionOptions: '+ "disableAllGestures" + "true", function(done) { + this.timeout(60000); + var cfg = { + gesture: { + + disableAllGestures: true + + } + }; + var instance = new module.Instance(cfg); + instance.start().then(function(){ + console.log('Start camera'); + assert.ok(true); + done(); + }).catch(function(){ + assert.ok(false); + done(); + }); + }); +}); diff --git a/misc/nodeapi-realsense-tests/realsense/gestureRecognitionOptions/test-gestureRecognitionOptions-enable-false-positive.js b/misc/nodeapi-realsense-tests/realsense/gestureRecognitionOptions/test-gestureRecognitionOptions-enable-false-positive.js new file mode 100644 index 000000000..6a5dfcfa1 --- /dev/null +++ b/misc/nodeapi-realsense-tests/realsense/gestureRecognitionOptions/test-gestureRecognitionOptions-enable-false-positive.js @@ -0,0 +1,34 @@ +"use strict" +var emitter = require('events').EventEmitter; +const assert = require('assert'); +var module = require('bindings')('realsense_pt'); + +function inherits(target, source) { + for (var k in source.prototype) { + target.prototype[k] = source.prototype[k]; + } +} + +inherits(module.Instance, emitter); + +describe('check enum GestureRecognitionOptions', function(done){ + it('checking member of GestureRecognitionOptions: '+ "enable" + "false", function(done) { + this.timeout(60000); + var cfg = { + gesture: { + + enable: false + + } + }; + var instance = new module.Instance(cfg); + instance.start().then(function(){ + console.log('Start camera'); + assert.ok(true); + done(); + }).catch(function(){ + assert.ok(false); + done(); + }); + }); +}); diff --git a/misc/nodeapi-realsense-tests/realsense/gestureRecognitionOptions/test-gestureRecognitionOptions-enable-true-positive.js b/misc/nodeapi-realsense-tests/realsense/gestureRecognitionOptions/test-gestureRecognitionOptions-enable-true-positive.js new file mode 100644 index 000000000..4e2aff735 --- /dev/null +++ b/misc/nodeapi-realsense-tests/realsense/gestureRecognitionOptions/test-gestureRecognitionOptions-enable-true-positive.js @@ -0,0 +1,34 @@ +"use strict" +var emitter = require('events').EventEmitter; +const assert = require('assert'); +var module = require('bindings')('realsense_pt'); + +function inherits(target, source) { + for (var k in source.prototype) { + target.prototype[k] = source.prototype[k]; + } +} + +inherits(module.Instance, emitter); + +describe('check enum GestureRecognitionOptions', function(done){ + it('checking member of GestureRecognitionOptions: '+ "enable" + "true", function(done) { + this.timeout(60000); + var cfg = { + gesture: { + + enable: true + + } + }; + var instance = new module.Instance(cfg); + instance.start().then(function(){ + console.log('Start camera'); + assert.ok(true); + done(); + }).catch(function(){ + assert.ok(false); + done(); + }); + }); +}); diff --git a/misc/nodeapi-realsense-tests/realsense/gestureRecognitionOptions/test-gestureRecognitionOptions-enableAllGestures-false-positive.js b/misc/nodeapi-realsense-tests/realsense/gestureRecognitionOptions/test-gestureRecognitionOptions-enableAllGestures-false-positive.js new file mode 100644 index 000000000..03a6c376d --- /dev/null +++ b/misc/nodeapi-realsense-tests/realsense/gestureRecognitionOptions/test-gestureRecognitionOptions-enableAllGestures-false-positive.js @@ -0,0 +1,34 @@ +"use strict" +var emitter = require('events').EventEmitter; +const assert = require('assert'); +var module = require('bindings')('realsense_pt'); + +function inherits(target, source) { + for (var k in source.prototype) { + target.prototype[k] = source.prototype[k]; + } +} + +inherits(module.Instance, emitter); + +describe('check enum GestureRecognitionOptions', function(done){ + it('checking member of GestureRecognitionOptions: '+ "enableAllGestures" + "false", function(done) { + this.timeout(60000); + var cfg = { + gesture: { + + enableAllGestures: false + + } + }; + var instance = new module.Instance(cfg); + instance.start().then(function(){ + console.log('Start camera'); + assert.ok(true); + done(); + }).catch(function(){ + assert.ok(false); + done(); + }); + }); +}); diff --git a/misc/nodeapi-realsense-tests/realsense/gestureRecognitionOptions/test-gestureRecognitionOptions-enableAllGestures-true-positive.js b/misc/nodeapi-realsense-tests/realsense/gestureRecognitionOptions/test-gestureRecognitionOptions-enableAllGestures-true-positive.js new file mode 100644 index 000000000..15b53dc73 --- /dev/null +++ b/misc/nodeapi-realsense-tests/realsense/gestureRecognitionOptions/test-gestureRecognitionOptions-enableAllGestures-true-positive.js @@ -0,0 +1,34 @@ +"use strict" +var emitter = require('events').EventEmitter; +const assert = require('assert'); +var module = require('bindings')('realsense_pt'); + +function inherits(target, source) { + for (var k in source.prototype) { + target.prototype[k] = source.prototype[k]; + } +} + +inherits(module.Instance, emitter); + +describe('check enum GestureRecognitionOptions', function(done){ + it('checking member of GestureRecognitionOptions: '+ "enableAllGestures" + "true", function(done) { + this.timeout(60000); + var cfg = { + gesture: { + + enableAllGestures: true + + } + }; + var instance = new module.Instance(cfg); + instance.start().then(function(){ + console.log('Start camera'); + assert.ok(true); + done(); + }).catch(function(){ + assert.ok(false); + done(); + }); + }); +}); diff --git a/misc/nodeapi-realsense-tests/realsense/gestureRecognitionOptions/test-gestureRecognitionOptions-enablePointing-false-positive.js b/misc/nodeapi-realsense-tests/realsense/gestureRecognitionOptions/test-gestureRecognitionOptions-enablePointing-false-positive.js new file mode 100644 index 000000000..b1bac6c56 --- /dev/null +++ b/misc/nodeapi-realsense-tests/realsense/gestureRecognitionOptions/test-gestureRecognitionOptions-enablePointing-false-positive.js @@ -0,0 +1,34 @@ +"use strict" +var emitter = require('events').EventEmitter; +const assert = require('assert'); +var module = require('bindings')('realsense_pt'); + +function inherits(target, source) { + for (var k in source.prototype) { + target.prototype[k] = source.prototype[k]; + } +} + +inherits(module.Instance, emitter); + +describe('check enum GestureRecognitionOptions', function(done){ + it('checking member of GestureRecognitionOptions: '+ "enablePointing" + "false", function(done) { + this.timeout(60000); + var cfg = { + gesture: { + + enablePointing: false + + } + }; + var instance = new module.Instance(cfg); + instance.start().then(function(){ + console.log('Start camera'); + assert.ok(true); + done(); + }).catch(function(){ + assert.ok(false); + done(); + }); + }); +}); diff --git a/misc/nodeapi-realsense-tests/realsense/gestureRecognitionOptions/test-gestureRecognitionOptions-enablePointing-true-positive.js b/misc/nodeapi-realsense-tests/realsense/gestureRecognitionOptions/test-gestureRecognitionOptions-enablePointing-true-positive.js new file mode 100644 index 000000000..b18806bab --- /dev/null +++ b/misc/nodeapi-realsense-tests/realsense/gestureRecognitionOptions/test-gestureRecognitionOptions-enablePointing-true-positive.js @@ -0,0 +1,34 @@ +"use strict" +var emitter = require('events').EventEmitter; +const assert = require('assert'); +var module = require('bindings')('realsense_pt'); + +function inherits(target, source) { + for (var k in source.prototype) { + target.prototype[k] = source.prototype[k]; + } +} + +inherits(module.Instance, emitter); + +describe('check enum GestureRecognitionOptions', function(done){ + it('checking member of GestureRecognitionOptions: '+ "enablePointing" + "true", function(done) { + this.timeout(60000); + var cfg = { + gesture: { + + enablePointing: true + + } + }; + var instance = new module.Instance(cfg); + instance.start().then(function(){ + console.log('Start camera'); + assert.ok(true); + done(); + }).catch(function(){ + assert.ok(false); + done(); + }); + }); +}); diff --git a/misc/nodeapi-realsense-tests/realsense/gestureRecognitionOptions/test-gestureRecognitionOptions-maxTrackedPerson-1-positive.js b/misc/nodeapi-realsense-tests/realsense/gestureRecognitionOptions/test-gestureRecognitionOptions-maxTrackedPerson-1-positive.js new file mode 100644 index 000000000..42618dfd4 --- /dev/null +++ b/misc/nodeapi-realsense-tests/realsense/gestureRecognitionOptions/test-gestureRecognitionOptions-maxTrackedPerson-1-positive.js @@ -0,0 +1,34 @@ +"use strict" +var emitter = require('events').EventEmitter; +const assert = require('assert'); +var module = require('bindings')('realsense_pt'); + +function inherits(target, source) { + for (var k in source.prototype) { + target.prototype[k] = source.prototype[k]; + } +} + +inherits(module.Instance, emitter); + +describe('check enum GestureRecognitionOptions', function(done){ + it('checking member of GestureRecognitionOptions: '+ "maxTrackedPerson" + "1", function(done) { + this.timeout(60000); + var cfg = { + gesture: { + + maxTrackedPerson: 1 + + } + }; + var instance = new module.Instance(cfg); + instance.start().then(function(){ + console.log('Start camera'); + assert.ok(true); + done(); + }).catch(function(){ + assert.ok(false); + done(); + }); + }); +}); diff --git a/misc/nodeapi-realsense-tests/realsense/gestureRecognitionOptions/test-gestureRecognitionOptions-maxTrackedPerson-2-positive.js b/misc/nodeapi-realsense-tests/realsense/gestureRecognitionOptions/test-gestureRecognitionOptions-maxTrackedPerson-2-positive.js new file mode 100644 index 000000000..3738af938 --- /dev/null +++ b/misc/nodeapi-realsense-tests/realsense/gestureRecognitionOptions/test-gestureRecognitionOptions-maxTrackedPerson-2-positive.js @@ -0,0 +1,34 @@ +"use strict" +var emitter = require('events').EventEmitter; +const assert = require('assert'); +var module = require('bindings')('realsense_pt'); + +function inherits(target, source) { + for (var k in source.prototype) { + target.prototype[k] = source.prototype[k]; + } +} + +inherits(module.Instance, emitter); + +describe('check enum GestureRecognitionOptions', function(done){ + it('checking member of GestureRecognitionOptions: '+ "maxTrackedPerson" + "2", function(done) { + this.timeout(60000); + var cfg = { + gesture: { + + maxTrackedPerson: 2 + + } + }; + var instance = new module.Instance(cfg); + instance.start().then(function(){ + console.log('Start camera'); + assert.ok(true); + done(); + }).catch(function(){ + assert.ok(false); + done(); + }); + }); +}); diff --git a/misc/nodeapi-realsense-tests/realsense/lyingPoseRecognitionOptions/test-lyingPoseRecognitionOptions-enable-false-positive.js b/misc/nodeapi-realsense-tests/realsense/lyingPoseRecognitionOptions/test-lyingPoseRecognitionOptions-enable-false-positive.js new file mode 100644 index 000000000..276e349f7 --- /dev/null +++ b/misc/nodeapi-realsense-tests/realsense/lyingPoseRecognitionOptions/test-lyingPoseRecognitionOptions-enable-false-positive.js @@ -0,0 +1,34 @@ +"use strict" +var emitter = require('events').EventEmitter; +const assert = require('assert'); +var module = require('bindings')('realsense_pt'); + +function inherits(target, source) { + for (var k in source.prototype) { + target.prototype[k] = source.prototype[k]; + } +} + +inherits(module.Instance, emitter); + +describe('check enum LyingPoseRecognitionOptions', function(done){ + it('checking member of LyingPoseRecognitionOptions: '+ "enable" + "false", function(done) { + this.timeout(60000); + var cfg = { + lying: { + + enable: false + + } + }; + var instance = new module.Instance(cfg); + instance.start().then(function(){ + console.log('Start camera'); + assert.ok(true); + done(); + }).catch(function(){ + assert.ok(false); + done(); + }); + }); +}); diff --git a/misc/nodeapi-realsense-tests/realsense/lyingPoseRecognitionOptions/test-lyingPoseRecognitionOptions-enable-true-positive.js b/misc/nodeapi-realsense-tests/realsense/lyingPoseRecognitionOptions/test-lyingPoseRecognitionOptions-enable-true-positive.js new file mode 100644 index 000000000..e963685b8 --- /dev/null +++ b/misc/nodeapi-realsense-tests/realsense/lyingPoseRecognitionOptions/test-lyingPoseRecognitionOptions-enable-true-positive.js @@ -0,0 +1,34 @@ +"use strict" +var emitter = require('events').EventEmitter; +const assert = require('assert'); +var module = require('bindings')('realsense_pt'); + +function inherits(target, source) { + for (var k in source.prototype) { + target.prototype[k] = source.prototype[k]; + } +} + +inherits(module.Instance, emitter); + +describe('check enum LyingPoseRecognitionOptions', function(done){ + it('checking member of LyingPoseRecognitionOptions: '+ "enable" + "true", function(done) { + this.timeout(60000); + var cfg = { + lying: { + + enable: true + + } + }; + var instance = new module.Instance(cfg); + instance.start().then(function(){ + console.log('Start camera'); + assert.ok(true); + done(); + }).catch(function(){ + assert.ok(false); + done(); + }); + }); +}); diff --git a/misc/nodeapi-realsense-tests/realsense/lyingPoseRecognitionOptions/test-lyingPoseRecognitionOptions-maxTrackedPerson-1-positive.js b/misc/nodeapi-realsense-tests/realsense/lyingPoseRecognitionOptions/test-lyingPoseRecognitionOptions-maxTrackedPerson-1-positive.js new file mode 100644 index 000000000..367a8ce64 --- /dev/null +++ b/misc/nodeapi-realsense-tests/realsense/lyingPoseRecognitionOptions/test-lyingPoseRecognitionOptions-maxTrackedPerson-1-positive.js @@ -0,0 +1,34 @@ +"use strict" +var emitter = require('events').EventEmitter; +const assert = require('assert'); +var module = require('bindings')('realsense_pt'); + +function inherits(target, source) { + for (var k in source.prototype) { + target.prototype[k] = source.prototype[k]; + } +} + +inherits(module.Instance, emitter); + +describe('check enum LyingPoseRecognitionOptions', function(done){ + it('checking member of LyingPoseRecognitionOptions: '+ "maxTrackedPerson" + "1", function(done) { + this.timeout(60000); + var cfg = { + lying: { + + maxTrackedPerson: 1 + + } + }; + var instance = new module.Instance(cfg); + instance.start().then(function(){ + console.log('Start camera'); + assert.ok(true); + done(); + }).catch(function(){ + assert.ok(false); + done(); + }); + }); +}); diff --git a/misc/nodeapi-realsense-tests/realsense/lyingPoseRecognitionOptions/test-lyingPoseRecognitionOptions-maxTrackedPerson-2-positive.js b/misc/nodeapi-realsense-tests/realsense/lyingPoseRecognitionOptions/test-lyingPoseRecognitionOptions-maxTrackedPerson-2-positive.js new file mode 100644 index 000000000..2c6a90dd5 --- /dev/null +++ b/misc/nodeapi-realsense-tests/realsense/lyingPoseRecognitionOptions/test-lyingPoseRecognitionOptions-maxTrackedPerson-2-positive.js @@ -0,0 +1,34 @@ +"use strict" +var emitter = require('events').EventEmitter; +const assert = require('assert'); +var module = require('bindings')('realsense_pt'); + +function inherits(target, source) { + for (var k in source.prototype) { + target.prototype[k] = source.prototype[k]; + } +} + +inherits(module.Instance, emitter); + +describe('check enum LyingPoseRecognitionOptions', function(done){ + it('checking member of LyingPoseRecognitionOptions: '+ "maxTrackedPerson" + "2", function(done) { + this.timeout(60000); + var cfg = { + lying: { + + maxTrackedPerson: 2 + + } + }; + var instance = new module.Instance(cfg); + instance.start().then(function(){ + console.log('Start camera'); + assert.ok(true); + done(); + }).catch(function(){ + assert.ok(false); + done(); + }); + }); +}); diff --git a/misc/nodeapi-realsense-tests/realsense/personPoseRecognitionOptions/test-personPoseRecognitionOptions-enable-false-positive.js b/misc/nodeapi-realsense-tests/realsense/personPoseRecognitionOptions/test-personPoseRecognitionOptions-enable-false-positive.js new file mode 100644 index 000000000..8c4bdf33e --- /dev/null +++ b/misc/nodeapi-realsense-tests/realsense/personPoseRecognitionOptions/test-personPoseRecognitionOptions-enable-false-positive.js @@ -0,0 +1,34 @@ +"use strict" +var emitter = require('events').EventEmitter; +const assert = require('assert'); +var module = require('bindings')('realsense_pt'); + +function inherits(target, source) { + for (var k in source.prototype) { + target.prototype[k] = source.prototype[k]; + } +} + +inherits(module.Instance, emitter); + +describe('check enum PersonPoseRecognitionOptions', function(done){ + it('checking member of PersonPoseRecognitionOptions: '+ "enable" + "false", function(done) { + this.timeout(60000); + var cfg = { + pose: { + + enable: false + + } + }; + var instance = new module.Instance(cfg); + instance.start().then(function(){ + console.log('Start camera'); + assert.ok(true); + done(); + }).catch(function(){ + assert.ok(false); + done(); + }); + }); +}); diff --git a/misc/nodeapi-realsense-tests/realsense/personPoseRecognitionOptions/test-personPoseRecognitionOptions-enable-true-positive.js b/misc/nodeapi-realsense-tests/realsense/personPoseRecognitionOptions/test-personPoseRecognitionOptions-enable-true-positive.js new file mode 100644 index 000000000..a6e93c3d4 --- /dev/null +++ b/misc/nodeapi-realsense-tests/realsense/personPoseRecognitionOptions/test-personPoseRecognitionOptions-enable-true-positive.js @@ -0,0 +1,34 @@ +"use strict" +var emitter = require('events').EventEmitter; +const assert = require('assert'); +var module = require('bindings')('realsense_pt'); + +function inherits(target, source) { + for (var k in source.prototype) { + target.prototype[k] = source.prototype[k]; + } +} + +inherits(module.Instance, emitter); + +describe('check enum PersonPoseRecognitionOptions', function(done){ + it('checking member of PersonPoseRecognitionOptions: '+ "enable" + "true", function(done) { + this.timeout(60000); + var cfg = { + pose: { + + enable: true + + } + }; + var instance = new module.Instance(cfg); + instance.start().then(function(){ + console.log('Start camera'); + assert.ok(true); + done(); + }).catch(function(){ + assert.ok(false); + done(); + }); + }); +}); diff --git a/misc/nodeapi-realsense-tests/realsense/personPoseRecognitionOptions/test-personPoseRecognitionOptions-maxTrackedPerson-1-positive.js b/misc/nodeapi-realsense-tests/realsense/personPoseRecognitionOptions/test-personPoseRecognitionOptions-maxTrackedPerson-1-positive.js new file mode 100644 index 000000000..b0f18a61b --- /dev/null +++ b/misc/nodeapi-realsense-tests/realsense/personPoseRecognitionOptions/test-personPoseRecognitionOptions-maxTrackedPerson-1-positive.js @@ -0,0 +1,34 @@ +"use strict" +var emitter = require('events').EventEmitter; +const assert = require('assert'); +var module = require('bindings')('realsense_pt'); + +function inherits(target, source) { + for (var k in source.prototype) { + target.prototype[k] = source.prototype[k]; + } +} + +inherits(module.Instance, emitter); + +describe('check enum PersonPoseRecognitionOptions', function(done){ + it('checking member of PersonPoseRecognitionOptions: '+ "maxTrackedPerson" + "1", function(done) { + this.timeout(60000); + var cfg = { + pose: { + + maxTrackedPerson: 1 + + } + }; + var instance = new module.Instance(cfg); + instance.start().then(function(){ + console.log('Start camera'); + assert.ok(true); + done(); + }).catch(function(){ + assert.ok(false); + done(); + }); + }); +}); diff --git a/misc/nodeapi-realsense-tests/realsense/personPoseRecognitionOptions/test-personPoseRecognitionOptions-maxTrackedPerson-2-positive.js b/misc/nodeapi-realsense-tests/realsense/personPoseRecognitionOptions/test-personPoseRecognitionOptions-maxTrackedPerson-2-positive.js new file mode 100644 index 000000000..abcc29c5b --- /dev/null +++ b/misc/nodeapi-realsense-tests/realsense/personPoseRecognitionOptions/test-personPoseRecognitionOptions-maxTrackedPerson-2-positive.js @@ -0,0 +1,34 @@ +"use strict" +var emitter = require('events').EventEmitter; +const assert = require('assert'); +var module = require('bindings')('realsense_pt'); + +function inherits(target, source) { + for (var k in source.prototype) { + target.prototype[k] = source.prototype[k]; + } +} + +inherits(module.Instance, emitter); + +describe('check enum PersonPoseRecognitionOptions', function(done){ + it('checking member of PersonPoseRecognitionOptions: '+ "maxTrackedPerson" + "2", function(done) { + this.timeout(60000); + var cfg = { + pose: { + + maxTrackedPerson: 2 + + } + }; + var instance = new module.Instance(cfg); + instance.start().then(function(){ + console.log('Start camera'); + assert.ok(true); + done(); + }).catch(function(){ + assert.ok(false); + done(); + }); + }); +}); diff --git a/misc/nodeapi-realsense-tests/realsense/skeletonRecognitionOptions/test-skeletonRecognitionOptions-enable-false-positive.js b/misc/nodeapi-realsense-tests/realsense/skeletonRecognitionOptions/test-skeletonRecognitionOptions-enable-false-positive.js new file mode 100644 index 000000000..e677bd993 --- /dev/null +++ b/misc/nodeapi-realsense-tests/realsense/skeletonRecognitionOptions/test-skeletonRecognitionOptions-enable-false-positive.js @@ -0,0 +1,34 @@ +"use strict" +var emitter = require('events').EventEmitter; +const assert = require('assert'); +var module = require('bindings')('realsense_pt'); + +function inherits(target, source) { + for (var k in source.prototype) { + target.prototype[k] = source.prototype[k]; + } +} + +inherits(module.Instance, emitter); + +describe('check enum SkeletonRecognitionOptions', function(done){ + it('checking member of SkeletonRecognitionOptions: '+ "enable" + "false", function(done) { + this.timeout(60000); + var cfg = { + skeleton: { + + enable: false + + } + }; + var instance = new module.Instance(cfg); + instance.start().then(function(){ + console.log('Start camera'); + assert.ok(true); + done(); + }).catch(function(){ + assert.ok(false); + done(); + }); + }); +}); diff --git a/misc/nodeapi-realsense-tests/realsense/skeletonRecognitionOptions/test-skeletonRecognitionOptions-enable-true-positive.js b/misc/nodeapi-realsense-tests/realsense/skeletonRecognitionOptions/test-skeletonRecognitionOptions-enable-true-positive.js new file mode 100644 index 000000000..a640cc40b --- /dev/null +++ b/misc/nodeapi-realsense-tests/realsense/skeletonRecognitionOptions/test-skeletonRecognitionOptions-enable-true-positive.js @@ -0,0 +1,34 @@ +"use strict" +var emitter = require('events').EventEmitter; +const assert = require('assert'); +var module = require('bindings')('realsense_pt'); + +function inherits(target, source) { + for (var k in source.prototype) { + target.prototype[k] = source.prototype[k]; + } +} + +inherits(module.Instance, emitter); + +describe('check enum SkeletonRecognitionOptions', function(done){ + it('checking member of SkeletonRecognitionOptions: '+ "enable" + "true", function(done) { + this.timeout(60000); + var cfg = { + skeleton: { + + enable: true + + } + }; + var instance = new module.Instance(cfg); + instance.start().then(function(){ + console.log('Start camera'); + assert.ok(true); + done(); + }).catch(function(){ + assert.ok(false); + done(); + }); + }); +}); diff --git a/misc/nodeapi-realsense-tests/realsense/skeletonRecognitionOptions/test-skeletonRecognitionOptions-maxTrackedPerson-1-positive.js b/misc/nodeapi-realsense-tests/realsense/skeletonRecognitionOptions/test-skeletonRecognitionOptions-maxTrackedPerson-1-positive.js new file mode 100644 index 000000000..da96e2925 --- /dev/null +++ b/misc/nodeapi-realsense-tests/realsense/skeletonRecognitionOptions/test-skeletonRecognitionOptions-maxTrackedPerson-1-positive.js @@ -0,0 +1,34 @@ +"use strict" +var emitter = require('events').EventEmitter; +const assert = require('assert'); +var module = require('bindings')('realsense_pt'); + +function inherits(target, source) { + for (var k in source.prototype) { + target.prototype[k] = source.prototype[k]; + } +} + +inherits(module.Instance, emitter); + +describe('check enum SkeletonRecognitionOptions', function(done){ + it('checking member of SkeletonRecognitionOptions: '+ "maxTrackedPerson" + "1", function(done) { + this.timeout(60000); + var cfg = { + skeleton: { + + maxTrackedPerson: 1 + + } + }; + var instance = new module.Instance(cfg); + instance.start().then(function(){ + console.log('Start camera'); + assert.ok(true); + done(); + }).catch(function(){ + assert.ok(false); + done(); + }); + }); +}); diff --git a/misc/nodeapi-realsense-tests/realsense/skeletonRecognitionOptions/test-skeletonRecognitionOptions-maxTrackedPerson-2-positive.js b/misc/nodeapi-realsense-tests/realsense/skeletonRecognitionOptions/test-skeletonRecognitionOptions-maxTrackedPerson-2-positive.js new file mode 100644 index 000000000..b5a782bd3 --- /dev/null +++ b/misc/nodeapi-realsense-tests/realsense/skeletonRecognitionOptions/test-skeletonRecognitionOptions-maxTrackedPerson-2-positive.js @@ -0,0 +1,34 @@ +"use strict" +var emitter = require('events').EventEmitter; +const assert = require('assert'); +var module = require('bindings')('realsense_pt'); + +function inherits(target, source) { + for (var k in source.prototype) { + target.prototype[k] = source.prototype[k]; + } +} + +inherits(module.Instance, emitter); + +describe('check enum SkeletonRecognitionOptions', function(done){ + it('checking member of SkeletonRecognitionOptions: '+ "maxTrackedPerson" + "2", function(done) { + this.timeout(60000); + var cfg = { + skeleton: { + + maxTrackedPerson: 2 + + } + }; + var instance = new module.Instance(cfg); + instance.start().then(function(){ + console.log('Start camera'); + assert.ok(true); + done(); + }).catch(function(){ + assert.ok(false); + done(); + }); + }); +}); diff --git a/misc/nodeapi-realsense-tests/realsense/skeletonRecognitionOptions/test-skeletonRecognitionOptions-trackingArea-full-body-positive.js b/misc/nodeapi-realsense-tests/realsense/skeletonRecognitionOptions/test-skeletonRecognitionOptions-trackingArea-full-body-positive.js new file mode 100644 index 000000000..52ae6d8ac --- /dev/null +++ b/misc/nodeapi-realsense-tests/realsense/skeletonRecognitionOptions/test-skeletonRecognitionOptions-trackingArea-full-body-positive.js @@ -0,0 +1,34 @@ +"use strict" +var emitter = require('events').EventEmitter; +const assert = require('assert'); +var module = require('bindings')('realsense_pt'); + +function inherits(target, source) { + for (var k in source.prototype) { + target.prototype[k] = source.prototype[k]; + } +} + +inherits(module.Instance, emitter); + +describe('check enum SkeletonRecognitionOptions', function(done){ + it('checking member of SkeletonRecognitionOptions: '+ "trackingArea" + "full-body", function(done) { + this.timeout(60000); + var cfg = { + skeleton: { + + trackingArea: 'full-body' + + } + }; + var instance = new module.Instance(cfg); + instance.start().then(function(){ + console.log('Start camera'); + assert.ok(true); + done(); + }).catch(function(){ + assert.ok(false); + done(); + }); + }); +}); diff --git a/misc/nodeapi-realsense-tests/realsense/skeletonRecognitionOptions/test-skeletonRecognitionOptions-trackingArea-full-body-rough-positive.js b/misc/nodeapi-realsense-tests/realsense/skeletonRecognitionOptions/test-skeletonRecognitionOptions-trackingArea-full-body-rough-positive.js new file mode 100644 index 000000000..f0170482c --- /dev/null +++ b/misc/nodeapi-realsense-tests/realsense/skeletonRecognitionOptions/test-skeletonRecognitionOptions-trackingArea-full-body-rough-positive.js @@ -0,0 +1,34 @@ +"use strict" +var emitter = require('events').EventEmitter; +const assert = require('assert'); +var module = require('bindings')('realsense_pt'); + +function inherits(target, source) { + for (var k in source.prototype) { + target.prototype[k] = source.prototype[k]; + } +} + +inherits(module.Instance, emitter); + +describe('check enum SkeletonRecognitionOptions', function(done){ + it('checking member of SkeletonRecognitionOptions: '+ "trackingArea" + "full-body-rough", function(done) { + this.timeout(60000); + var cfg = { + skeleton: { + + trackingArea: 'full-body-rough' + + } + }; + var instance = new module.Instance(cfg); + instance.start().then(function(){ + console.log('Start camera'); + assert.ok(true); + done(); + }).catch(function(){ + assert.ok(false); + done(); + }); + }); +}); diff --git a/misc/nodeapi-realsense-tests/realsense/skeletonRecognitionOptions/test-skeletonRecognitionOptions-trackingArea-upper-body-positive.js b/misc/nodeapi-realsense-tests/realsense/skeletonRecognitionOptions/test-skeletonRecognitionOptions-trackingArea-upper-body-positive.js new file mode 100644 index 000000000..13a087064 --- /dev/null +++ b/misc/nodeapi-realsense-tests/realsense/skeletonRecognitionOptions/test-skeletonRecognitionOptions-trackingArea-upper-body-positive.js @@ -0,0 +1,34 @@ +"use strict" +var emitter = require('events').EventEmitter; +const assert = require('assert'); +var module = require('bindings')('realsense_pt'); + +function inherits(target, source) { + for (var k in source.prototype) { + target.prototype[k] = source.prototype[k]; + } +} + +inherits(module.Instance, emitter); + +describe('check enum SkeletonRecognitionOptions', function(done){ + it('checking member of SkeletonRecognitionOptions: '+ "trackingArea" + "upper-body", function(done) { + this.timeout(60000); + var cfg = { + skeleton: { + + trackingArea: 'upper-body' + + } + }; + var instance = new module.Instance(cfg); + instance.start().then(function(){ + console.log('Start camera'); + assert.ok(true); + done(); + }).catch(function(){ + assert.ok(false); + done(); + }); + }); +}); diff --git a/misc/nodeapi-realsense-tests/realsense/skeletonRecognitionOptions/test-skeletonRecognitionOptions-trackingArea-upper-body-rough-positive.js b/misc/nodeapi-realsense-tests/realsense/skeletonRecognitionOptions/test-skeletonRecognitionOptions-trackingArea-upper-body-rough-positive.js new file mode 100644 index 000000000..2a7fe7c30 --- /dev/null +++ b/misc/nodeapi-realsense-tests/realsense/skeletonRecognitionOptions/test-skeletonRecognitionOptions-trackingArea-upper-body-rough-positive.js @@ -0,0 +1,34 @@ +"use strict" +var emitter = require('events').EventEmitter; +const assert = require('assert'); +var module = require('bindings')('realsense_pt'); + +function inherits(target, source) { + for (var k in source.prototype) { + target.prototype[k] = source.prototype[k]; + } +} + +inherits(module.Instance, emitter); + +describe('check enum SkeletonRecognitionOptions', function(done){ + it('checking member of SkeletonRecognitionOptions: '+ "trackingArea" + "upper-body-rough", function(done) { + this.timeout(60000); + var cfg = { + skeleton: { + + trackingArea: 'upper-body-rough' + + } + }; + var instance = new module.Instance(cfg); + instance.start().then(function(){ + console.log('Start camera'); + assert.ok(true); + done(); + }).catch(function(){ + assert.ok(false); + done(); + }); + }); +}); diff --git a/misc/nodeapi-realsense-tests/realsense/test-facerecognition-api-existence.js b/misc/nodeapi-realsense-tests/realsense/test-facerecognition-api-existence.js new file mode 100644 index 000000000..bef10f4e5 --- /dev/null +++ b/misc/nodeapi-realsense-tests/realsense/test-facerecognition-api-existence.js @@ -0,0 +1,73 @@ +"use strict" +const assert = require('assert'); +var util = require('./util.js'); +var module = require('bindings')('realsense_pt'); + +var instanceConfig = {}; +instanceConfig = { + lying: { + enable: true, + maxTrackedPerson:1 + } +}; +var cameraConfig = {}; +var instance = util.getObj(module, "FaceRecognition", instanceConfig, cameraConfig).instance; +var obj = util.getObj(module, "FaceRecognition", instanceConfig, cameraConfig).obj; +describe('FaceRecognition API Test', function () { + + describe('API Existance', function() { + it('module.FaceRecognition is exist', function() { + assert.ok(typeof(obj) !== 'undefined' ) + }); + + it('module.FaceRecognition type is correct', function() { + assert.equal(typeof(obj),'object'); + }); + + it('new module.FaceRecognition() object has a method .getRegisteredIDs', function () { + assert.equal(typeof(obj.getRegisteredIDs), 'function'); + }); + + it('new module.FaceRecognition() object has a method .clearDatabase', function () { + assert.equal(typeof(obj.clearDatabase), 'function'); + }); + + it('new module.FaceRecognition() object has a method .exportDatabase', function () { + assert.equal(typeof(obj.exportDatabase), 'function'); + }); + + it('new module.FaceRecognition() object has a method .importDatabase', function () { + assert.equal(typeof(obj.importDatabase), 'function'); + }); + + it('new module.FaceRecognition() object has a method .recognizeAll', function () { + assert.equal(typeof(obj.recognizeAll), 'function'); + }); + + it('new module.FaceRecognition() object has a method .registerPerson', function () { + assert.equal(typeof(obj.registerPerson), 'function'); + }); + + it('new module.FaceRecognition() object has a method .unRegisterPerson', function () { + assert.equal(typeof(obj.unRegisterPerson), 'function'); + }); + + it('new module.FaceRecognition() object has a method .isPersonRegistered', function () { + assert.equal(typeof(obj.isPersonRegistered), 'function'); + }); + + it('new module.FaceRecognition() object has a method .reinforceRegistration', function () { + assert.equal(typeof(obj.reinforceRegistration), 'function'); + }); + + it('new module.FaceRecognition() object has a method .recognize', function () { + assert.equal(typeof(obj.recognize), 'function'); + }); + + it('new module.FaceRecognition() object has a method .querySimilarityScoreByID', function () { + assert.equal(typeof(obj.querySimilarityScoreByID), 'function'); + }); + + }); + +}); diff --git a/misc/nodeapi-realsense-tests/realsense/test-instance-api-existence.js b/misc/nodeapi-realsense-tests/realsense/test-instance-api-existence.js new file mode 100644 index 000000000..5187e5701 --- /dev/null +++ b/misc/nodeapi-realsense-tests/realsense/test-instance-api-existence.js @@ -0,0 +1,101 @@ +"use strict" +const assert = require('assert'); +var util = require('./util.js'); +var module = require('bindings')('realsense_pt'); + +var instanceConfig = {}; +instanceConfig = { + lying: { + enable: true, + maxTrackedPerson:1 + } +}; +var cameraConfig = {}; +var instance = util.getObj(module, "Instance", instanceConfig, cameraConfig).instance; +var obj = util.getObj(module, "Instance", instanceConfig, cameraConfig).obj; +describe('Instance API Test', function () { + + describe('API Existance', function() { + it('module.Instance is exist', function() { + assert.ok(typeof(obj) !== 'undefined' ) + }); + + it('module.Instance type is correct', function() { + assert.equal(typeof(obj),'object'); + }); + + it('module.Instance() object has the attribute state', function () { + assert.ok(obj.state !== undefined ); + }); + it('module.Instance() object has the object attribute state', function () { + assert.equal(typeof(obj.state),'object'); + }); + + it('module.Instance() object has the readonly attribute state', function () { + assert.throws(() => {obj.state = null}); + }); + + it('new module.Instance() object has a method .getInstanceOptions', function () { + assert.equal(typeof(obj.getInstanceOptions), 'function'); + }); + + it('new module.Instance() object has a method .setInstanceOptions', function () { + assert.equal(typeof(obj.setInstanceOptions), 'function'); + }); + + it('new module.Instance() object has a method .start', function () { + assert.equal(typeof(obj.start), 'function'); + }); + + it('new module.Instance() object has a method .stop', function () { + assert.equal(typeof(obj.stop), 'function'); + }); + + it('new module.Instance() object has a method .pause', function () { + assert.equal(typeof(obj.pause), 'function'); + }); + + it('new module.Instance() object has a method .resume', function () { + assert.equal(typeof(obj.resume), 'function'); + }); + + it('new module.Instance() object has a method .reset', function () { + assert.equal(typeof(obj.reset), 'function'); + }); + + it('module.Instance() object has the attribute faceRecognition', function () { + assert.ok(obj.faceRecognition !== undefined ); + }); + it('module.Instance() object has the object attribute faceRecognition', function () { + assert.equal(typeof(obj.faceRecognition),'object'); + }); + + it('module.Instance() object has the readonly attribute faceRecognition', function () { + assert.throws(() => {obj.faceRecognition = null}); + }); + + it('module.Instance() object has the attribute lyingPoseRecognition', function () { + assert.ok(obj.lyingPoseRecognition !== undefined ); + }); + it('module.Instance() object has the object attribute lyingPoseRecognition', function () { + assert.equal(typeof(obj.lyingPoseRecognition),'object'); + }); + + it('module.Instance() object has the readonly attribute lyingPoseRecognition', function () { + assert.throws(() => {obj.lyingPoseRecognition = null}); + }); + + it('module.Instance() object has the attribute personTracking', function () { + assert.ok(obj.personTracking !== undefined ); + }); + it('module.Instance() object has the object attribute personTracking', function () { + assert.equal(typeof(obj.personTracking),'object'); + }); + + it('module.Instance() object has the readonly attribute personTracking', function () { + assert.throws(() => {obj.personTracking = null}); + }); + + }); + +}); diff --git a/misc/nodeapi-realsense-tests/realsense/test-lyingposeinfo-api-existence.js b/misc/nodeapi-realsense-tests/realsense/test-lyingposeinfo-api-existence.js new file mode 100644 index 000000000..b213db363 --- /dev/null +++ b/misc/nodeapi-realsense-tests/realsense/test-lyingposeinfo-api-existence.js @@ -0,0 +1,85 @@ +"use strict" +const assert = require('assert'); +var util = require('./util.js'); +var module = require('bindings')('realsense_pt'); + +var instanceConfig = {}; +instanceConfig = { + lying: { + enable: true, + maxTrackedPerson:1 + } +}; +var cameraConfig = {}; +var instance = util.getObj(module, "LyingPoseInfo", instanceConfig, cameraConfig).instance; +var obj = util.getObj(module, "LyingPoseInfo", instanceConfig, cameraConfig).obj; +describe('LyingPoseInfo API Test', function () { + + describe('API Existance', function() { + it('module.LyingPoseInfo is exist', function() { + assert.ok(typeof(obj) !== 'undefined' ) + }); + + it('module.LyingPoseInfo type is correct', function() { + assert.equal(typeof(obj),'object'); + }); + + it('module.LyingPoseInfo() object has the attribute position', function () { + assert.ok(obj.position !== undefined ); + }); + it('module.LyingPoseInfo() object has the object attribute position', function () { + assert.equal(typeof(obj.position),'object'); + }); + + it('module.LyingPoseInfo() object has the writable attribute position', function () { + var tmp; + tmp = obj.position; + obj.position = null; + assert.notEqual(tmp, obj.position); + }); + + it('module.LyingPoseInfo() object has the attribute boundingBox', function () { + assert.ok(obj.boundingBox !== undefined ); + }); + it('module.LyingPoseInfo() object has the object attribute boundingBox', function () { + assert.equal(typeof(obj.boundingBox),'object'); + }); + + it('module.LyingPoseInfo() object has the writable attribute boundingBox', function () { + var tmp; + tmp = obj.boundingBox; + obj.boundingBox = null; + assert.notEqual(tmp, obj.boundingBox); + }); + + it('module.LyingPoseInfo() object has the attribute result', function () { + assert.ok(obj.result !== undefined ); + }); + it('module.LyingPoseInfo() object has the object attribute result', function () { + assert.equal(typeof(obj.result),'object'); + }); + + it('module.LyingPoseInfo() object has the writable attribute result', function () { + var tmp; + tmp = obj.result; + obj.result = null; + assert.notEqual(tmp, obj.result); + }); + + it('module.LyingPoseInfo() object has the attribute confidence', function () { + assert.ok(obj.confidence !== undefined ); + }); + it('module.LyingPoseInfo() object has the number attribute confidence', function () { + assert.equal(typeof(obj.confidence),'number'); + }); + + it('module.LyingPoseInfo() object has the writable attribute confidence', function () { + var tmp; + tmp = obj.confidence; + obj.confidence = NaN; + assert.notEqual(tmp, obj.confidence); + }); + + }); + +}); diff --git a/misc/nodeapi-realsense-tests/realsense/test-lyingposerecognition-api-existence.js b/misc/nodeapi-realsense-tests/realsense/test-lyingposerecognition-api-existence.js new file mode 100644 index 000000000..5624da311 --- /dev/null +++ b/misc/nodeapi-realsense-tests/realsense/test-lyingposerecognition-api-existence.js @@ -0,0 +1,45 @@ +"use strict" +const assert = require('assert'); +var util = require('./util.js'); +var module = require('bindings')('realsense_pt'); + +var instanceConfig = {}; +instanceConfig = { + lying: { + enable: true, + maxTrackedPerson:1 + } +}; +var cameraConfig = {}; +var instance = util.getObj(module, "LyingPoseRecognition", instanceConfig, cameraConfig).instance; +var obj = util.getObj(module, "LyingPoseRecognition", instanceConfig, cameraConfig).obj; +describe('LyingPoseRecognition API Test', function () { + + describe('API Existance', function() { + it('module.LyingPoseRecognition is exist', function() { + assert.ok(typeof(obj) !== 'undefined' ) + }); + + it('module.LyingPoseRecognition type is correct', function() { + assert.equal(typeof(obj),'object'); + }); + + it('new module.LyingPoseRecognition() object has a method .setRecognitionState', function () { + assert.equal(typeof(obj.setRecognitionState), 'function'); + }); + + it('new module.LyingPoseRecognition() object has a method .getRecognitionState', function () { + assert.equal(typeof(obj.getRecognitionState), 'function'); + }); + + it('new module.LyingPoseRecognition() object has a method .getCandidatesCount', function () { + assert.equal(typeof(obj.getCandidatesCount), 'function'); + }); + + it('new module.LyingPoseRecognition() object has a method .getCandidatesData', function () { + assert.equal(typeof(obj.getCandidatesData), 'function'); + }); + + }); + +}); diff --git a/misc/nodeapi-realsense-tests/realsense/test-persontracking-api-existence.js b/misc/nodeapi-realsense-tests/realsense/test-persontracking-api-existence.js new file mode 100644 index 000000000..ef4a0e9d1 --- /dev/null +++ b/misc/nodeapi-realsense-tests/realsense/test-persontracking-api-existence.js @@ -0,0 +1,37 @@ +"use strict" +const assert = require('assert'); +var util = require('./util.js'); +var module = require('bindings')('realsense_pt'); + +var instanceConfig = {}; +instanceConfig = { + lying: { + enable: true, + maxTrackedPerson:1 + } +}; +var cameraConfig = {}; +var instance = util.getObj(module, "PersonTracking", instanceConfig, cameraConfig).instance; +var obj = util.getObj(module, "PersonTracking", instanceConfig, cameraConfig).obj; +describe('PersonTracking API Test', function () { + + describe('API Existance', function() { + it('module.PersonTracking is exist', function() { + assert.ok(typeof(obj) !== 'undefined' ) + }); + + it('module.PersonTracking type is correct', function() { + assert.equal(typeof(obj),'object'); + }); + + it('new module.PersonTracking() object has a method .startTrackingPerson', function () { + assert.equal(typeof(obj.startTrackingPerson), 'function'); + }); + + it('new module.PersonTracking() object has a method .stopTrackingPerson', function () { + assert.equal(typeof(obj.stopTrackingPerson), 'function'); + }); + + }); + +}); diff --git a/misc/nodeapi-realsense-tests/realsense/test-recognitioninfo-api-existence.js b/misc/nodeapi-realsense-tests/realsense/test-recognitioninfo-api-existence.js new file mode 100644 index 000000000..754df9541 --- /dev/null +++ b/misc/nodeapi-realsense-tests/realsense/test-recognitioninfo-api-existence.js @@ -0,0 +1,71 @@ +"use strict" +const assert = require('assert'); +var util = require('./util.js'); +var module = require('bindings')('realsense_pt'); + +var instanceConfig = {}; +instanceConfig = { + lying: { + enable: true, + maxTrackedPerson:1 + } +}; +var cameraConfig = {}; +var instance = util.getObj(module, "RecognitionInfo", instanceConfig, cameraConfig).instance; +var obj = util.getObj(module, "RecognitionInfo", instanceConfig, cameraConfig).obj; +describe('RecognitionInfo API Test', function () { + + describe('API Existance', function() { + it('module.RecognitionInfo is exist', function() { + assert.ok(typeof(obj) !== 'undefined' ) + }); + + it('module.RecognitionInfo type is correct', function() { + assert.equal(typeof(obj),'object'); + }); + + it('module.RecognitionInfo() object has the attribute trackID', function () { + assert.ok(obj.trackID !== undefined ); + }); + it('module.RecognitionInfo() object has the number attribute trackID', function () { + assert.equal(typeof(obj.trackID),'number'); + }); + + it('module.RecognitionInfo() object has the writable attribute trackID', function () { + var tmp; + tmp = obj.trackID; + obj.trackID = NaN; + assert.notEqual(tmp, obj.trackID); + }); + + it('module.RecognitionInfo() object has the attribute recognitionID', function () { + assert.ok(obj.recognitionID !== undefined ); + }); + it('module.RecognitionInfo() object has the number attribute recognitionID', function () { + assert.equal(typeof(obj.recognitionID),'number'); + }); + + it('module.RecognitionInfo() object has the writable attribute recognitionID', function () { + var tmp; + tmp = obj.recognitionID; + obj.recognitionID = NaN; + assert.notEqual(tmp, obj.recognitionID); + }); + + it('module.RecognitionInfo() object has the attribute similarityScore', function () { + assert.ok(obj.similarityScore !== undefined ); + }); + it('module.RecognitionInfo() object has the number attribute similarityScore', function () { + assert.equal(typeof(obj.similarityScore),'number'); + }); + + it('module.RecognitionInfo() object has the writable attribute similarityScore', function () { + var tmp; + tmp = obj.similarityScore; + obj.similarityScore = NaN; + assert.notEqual(tmp, obj.similarityScore); + }); + + }); + +}); diff --git a/misc/nodeapi-realsense-tests/realsense/trackingOptions/test-trackingOptions-detectMode-all-positive.js b/misc/nodeapi-realsense-tests/realsense/trackingOptions/test-trackingOptions-detectMode-all-positive.js new file mode 100644 index 000000000..3f59a3ca7 --- /dev/null +++ b/misc/nodeapi-realsense-tests/realsense/trackingOptions/test-trackingOptions-detectMode-all-positive.js @@ -0,0 +1,34 @@ +"use strict" +var emitter = require('events').EventEmitter; +const assert = require('assert'); +var module = require('bindings')('realsense_pt'); + +function inherits(target, source) { + for (var k in source.prototype) { + target.prototype[k] = source.prototype[k]; + } +} + +inherits(module.Instance, emitter); + +describe('check enum TrackingOptions', function(done){ + it('checking member of TrackingOptions: '+ "detectMode" + "all", function(done) { + this.timeout(60000); + var cfg = { + tracking: { + + detectMode: 'all' + + } + }; + var instance = new module.Instance(cfg); + instance.start().then(function(){ + console.log('Start camera'); + assert.ok(true); + done(); + }).catch(function(){ + assert.ok(false); + done(); + }); + }); +}); diff --git a/misc/nodeapi-realsense-tests/realsense/trackingOptions/test-trackingOptions-detectMode-auto-positive.js b/misc/nodeapi-realsense-tests/realsense/trackingOptions/test-trackingOptions-detectMode-auto-positive.js new file mode 100644 index 000000000..3408983c3 --- /dev/null +++ b/misc/nodeapi-realsense-tests/realsense/trackingOptions/test-trackingOptions-detectMode-auto-positive.js @@ -0,0 +1,34 @@ +"use strict" +var emitter = require('events').EventEmitter; +const assert = require('assert'); +var module = require('bindings')('realsense_pt'); + +function inherits(target, source) { + for (var k in source.prototype) { + target.prototype[k] = source.prototype[k]; + } +} + +inherits(module.Instance, emitter); + +describe('check enum TrackingOptions', function(done){ + it('checking member of TrackingOptions: '+ "detectMode" + "auto", function(done) { + this.timeout(60000); + var cfg = { + tracking: { + + detectMode: 'auto' + + } + }; + var instance = new module.Instance(cfg); + instance.start().then(function(){ + console.log('Start camera'); + assert.ok(true); + done(); + }).catch(function(){ + assert.ok(false); + done(); + }); + }); +}); diff --git a/misc/nodeapi-realsense-tests/realsense/trackingOptions/test-trackingOptions-detectMode-close-range-positive.js b/misc/nodeapi-realsense-tests/realsense/trackingOptions/test-trackingOptions-detectMode-close-range-positive.js new file mode 100644 index 000000000..ac130e4ea --- /dev/null +++ b/misc/nodeapi-realsense-tests/realsense/trackingOptions/test-trackingOptions-detectMode-close-range-positive.js @@ -0,0 +1,34 @@ +"use strict" +var emitter = require('events').EventEmitter; +const assert = require('assert'); +var module = require('bindings')('realsense_pt'); + +function inherits(target, source) { + for (var k in source.prototype) { + target.prototype[k] = source.prototype[k]; + } +} + +inherits(module.Instance, emitter); + +describe('check enum TrackingOptions', function(done){ + it('checking member of TrackingOptions: '+ "detectMode" + "close-range", function(done) { + this.timeout(60000); + var cfg = { + tracking: { + + detectMode: 'close-range' + + } + }; + var instance = new module.Instance(cfg); + instance.start().then(function(){ + console.log('Start camera'); + assert.ok(true); + done(); + }).catch(function(){ + assert.ok(false); + done(); + }); + }); +}); diff --git a/misc/nodeapi-realsense-tests/realsense/trackingOptions/test-trackingOptions-detectMode-far-range-positive.js b/misc/nodeapi-realsense-tests/realsense/trackingOptions/test-trackingOptions-detectMode-far-range-positive.js new file mode 100644 index 000000000..33db015e2 --- /dev/null +++ b/misc/nodeapi-realsense-tests/realsense/trackingOptions/test-trackingOptions-detectMode-far-range-positive.js @@ -0,0 +1,34 @@ +"use strict" +var emitter = require('events').EventEmitter; +const assert = require('assert'); +var module = require('bindings')('realsense_pt'); + +function inherits(target, source) { + for (var k in source.prototype) { + target.prototype[k] = source.prototype[k]; + } +} + +inherits(module.Instance, emitter); + +describe('check enum TrackingOptions', function(done){ + it('checking member of TrackingOptions: '+ "detectMode" + "far-range", function(done) { + this.timeout(60000); + var cfg = { + tracking: { + + detectMode: 'far-range' + + } + }; + var instance = new module.Instance(cfg); + instance.start().then(function(){ + console.log('Start camera'); + assert.ok(true); + done(); + }).catch(function(){ + assert.ok(false); + done(); + }); + }); +}); diff --git a/misc/nodeapi-realsense-tests/realsense/trackingOptions/test-trackingOptions-detectMode-full-range-positive.js b/misc/nodeapi-realsense-tests/realsense/trackingOptions/test-trackingOptions-detectMode-full-range-positive.js new file mode 100644 index 000000000..bbe2f3b80 --- /dev/null +++ b/misc/nodeapi-realsense-tests/realsense/trackingOptions/test-trackingOptions-detectMode-full-range-positive.js @@ -0,0 +1,34 @@ +"use strict" +var emitter = require('events').EventEmitter; +const assert = require('assert'); +var module = require('bindings')('realsense_pt'); + +function inherits(target, source) { + for (var k in source.prototype) { + target.prototype[k] = source.prototype[k]; + } +} + +inherits(module.Instance, emitter); + +describe('check enum TrackingOptions', function(done){ + it('checking member of TrackingOptions: '+ "detectMode" + "full-range", function(done) { + this.timeout(60000); + var cfg = { + tracking: { + + detectMode: 'full-range' + + } + }; + var instance = new module.Instance(cfg); + instance.start().then(function(){ + console.log('Start camera'); + assert.ok(true); + done(); + }).catch(function(){ + assert.ok(false); + done(); + }); + }); +}); diff --git a/misc/nodeapi-realsense-tests/realsense/trackingOptions/test-trackingOptions-detectMode-mid-range-positive.js b/misc/nodeapi-realsense-tests/realsense/trackingOptions/test-trackingOptions-detectMode-mid-range-positive.js new file mode 100644 index 000000000..f01be5cac --- /dev/null +++ b/misc/nodeapi-realsense-tests/realsense/trackingOptions/test-trackingOptions-detectMode-mid-range-positive.js @@ -0,0 +1,34 @@ +"use strict" +var emitter = require('events').EventEmitter; +const assert = require('assert'); +var module = require('bindings')('realsense_pt'); + +function inherits(target, source) { + for (var k in source.prototype) { + target.prototype[k] = source.prototype[k]; + } +} + +inherits(module.Instance, emitter); + +describe('check enum TrackingOptions', function(done){ + it('checking member of TrackingOptions: '+ "detectMode" + "mid-range", function(done) { + this.timeout(60000); + var cfg = { + tracking: { + + detectMode: 'mid-range' + + } + }; + var instance = new module.Instance(cfg); + instance.start().then(function(){ + console.log('Start camera'); + assert.ok(true); + done(); + }).catch(function(){ + assert.ok(false); + done(); + }); + }); +}); diff --git a/misc/nodeapi-realsense-tests/realsense/trackingOptions/test-trackingOptions-enable-false-positive.js b/misc/nodeapi-realsense-tests/realsense/trackingOptions/test-trackingOptions-enable-false-positive.js new file mode 100644 index 000000000..b30332d19 --- /dev/null +++ b/misc/nodeapi-realsense-tests/realsense/trackingOptions/test-trackingOptions-enable-false-positive.js @@ -0,0 +1,34 @@ +"use strict" +var emitter = require('events').EventEmitter; +const assert = require('assert'); +var module = require('bindings')('realsense_pt'); + +function inherits(target, source) { + for (var k in source.prototype) { + target.prototype[k] = source.prototype[k]; + } +} + +inherits(module.Instance, emitter); + +describe('check enum TrackingOptions', function(done){ + it('checking member of TrackingOptions: '+ "enable" + "false", function(done) { + this.timeout(60000); + var cfg = { + tracking: { + + enable: false + + } + }; + var instance = new module.Instance(cfg); + instance.start().then(function(){ + console.log('Start camera'); + assert.ok(true); + done(); + }).catch(function(){ + assert.ok(false); + done(); + }); + }); +}); diff --git a/misc/nodeapi-realsense-tests/realsense/trackingOptions/test-trackingOptions-enable-true-positive.js b/misc/nodeapi-realsense-tests/realsense/trackingOptions/test-trackingOptions-enable-true-positive.js new file mode 100644 index 000000000..2fa7a1192 --- /dev/null +++ b/misc/nodeapi-realsense-tests/realsense/trackingOptions/test-trackingOptions-enable-true-positive.js @@ -0,0 +1,34 @@ +"use strict" +var emitter = require('events').EventEmitter; +const assert = require('assert'); +var module = require('bindings')('realsense_pt'); + +function inherits(target, source) { + for (var k in source.prototype) { + target.prototype[k] = source.prototype[k]; + } +} + +inherits(module.Instance, emitter); + +describe('check enum TrackingOptions', function(done){ + it('checking member of TrackingOptions: '+ "enable" + "true", function(done) { + this.timeout(60000); + var cfg = { + tracking: { + + enable: true + + } + }; + var instance = new module.Instance(cfg); + instance.start().then(function(){ + console.log('Start camera'); + assert.ok(true); + done(); + }).catch(function(){ + assert.ok(false); + done(); + }); + }); +}); diff --git a/misc/nodeapi-realsense-tests/realsense/trackingOptions/test-trackingOptions-enableBlob-false-positive.js b/misc/nodeapi-realsense-tests/realsense/trackingOptions/test-trackingOptions-enableBlob-false-positive.js new file mode 100644 index 000000000..f5cc7c39d --- /dev/null +++ b/misc/nodeapi-realsense-tests/realsense/trackingOptions/test-trackingOptions-enableBlob-false-positive.js @@ -0,0 +1,34 @@ +"use strict" +var emitter = require('events').EventEmitter; +const assert = require('assert'); +var module = require('bindings')('realsense_pt'); + +function inherits(target, source) { + for (var k in source.prototype) { + target.prototype[k] = source.prototype[k]; + } +} + +inherits(module.Instance, emitter); + +describe('check enum TrackingOptions', function(done){ + it('checking member of TrackingOptions: '+ "enableBlob" + "false", function(done) { + this.timeout(60000); + var cfg = { + tracking: { + + enableBlob: false + + } + }; + var instance = new module.Instance(cfg); + instance.start().then(function(){ + console.log('Start camera'); + assert.ok(true); + done(); + }).catch(function(){ + assert.ok(false); + done(); + }); + }); +}); diff --git a/misc/nodeapi-realsense-tests/realsense/trackingOptions/test-trackingOptions-enableBlob-true-positive.js b/misc/nodeapi-realsense-tests/realsense/trackingOptions/test-trackingOptions-enableBlob-true-positive.js new file mode 100644 index 000000000..8a8132ba1 --- /dev/null +++ b/misc/nodeapi-realsense-tests/realsense/trackingOptions/test-trackingOptions-enableBlob-true-positive.js @@ -0,0 +1,34 @@ +"use strict" +var emitter = require('events').EventEmitter; +const assert = require('assert'); +var module = require('bindings')('realsense_pt'); + +function inherits(target, source) { + for (var k in source.prototype) { + target.prototype[k] = source.prototype[k]; + } +} + +inherits(module.Instance, emitter); + +describe('check enum TrackingOptions', function(done){ + it('checking member of TrackingOptions: '+ "enableBlob" + "true", function(done) { + this.timeout(60000); + var cfg = { + tracking: { + + enableBlob: true + + } + }; + var instance = new module.Instance(cfg); + instance.start().then(function(){ + console.log('Start camera'); + assert.ok(true); + done(); + }).catch(function(){ + assert.ok(false); + done(); + }); + }); +}); diff --git a/misc/nodeapi-realsense-tests/realsense/trackingOptions/test-trackingOptions-enableDetectionFromFar-false-positive.js b/misc/nodeapi-realsense-tests/realsense/trackingOptions/test-trackingOptions-enableDetectionFromFar-false-positive.js new file mode 100644 index 000000000..cc4c0529b --- /dev/null +++ b/misc/nodeapi-realsense-tests/realsense/trackingOptions/test-trackingOptions-enableDetectionFromFar-false-positive.js @@ -0,0 +1,34 @@ +"use strict" +var emitter = require('events').EventEmitter; +const assert = require('assert'); +var module = require('bindings')('realsense_pt'); + +function inherits(target, source) { + for (var k in source.prototype) { + target.prototype[k] = source.prototype[k]; + } +} + +inherits(module.Instance, emitter); + +describe('check enum TrackingOptions', function(done){ + it('checking member of TrackingOptions: '+ "enableDetectionFromFar" + "false", function(done) { + this.timeout(60000); + var cfg = { + tracking: { + + enableDetectionFromFar: false + + } + }; + var instance = new module.Instance(cfg); + instance.start().then(function(){ + console.log('Start camera'); + assert.ok(true); + done(); + }).catch(function(){ + assert.ok(false); + done(); + }); + }); +}); diff --git a/misc/nodeapi-realsense-tests/realsense/trackingOptions/test-trackingOptions-enableDetectionFromFar-true-positive.js b/misc/nodeapi-realsense-tests/realsense/trackingOptions/test-trackingOptions-enableDetectionFromFar-true-positive.js new file mode 100644 index 000000000..d84f1b79e --- /dev/null +++ b/misc/nodeapi-realsense-tests/realsense/trackingOptions/test-trackingOptions-enableDetectionFromFar-true-positive.js @@ -0,0 +1,34 @@ +"use strict" +var emitter = require('events').EventEmitter; +const assert = require('assert'); +var module = require('bindings')('realsense_pt'); + +function inherits(target, source) { + for (var k in source.prototype) { + target.prototype[k] = source.prototype[k]; + } +} + +inherits(module.Instance, emitter); + +describe('check enum TrackingOptions', function(done){ + it('checking member of TrackingOptions: '+ "enableDetectionFromFar" + "true", function(done) { + this.timeout(60000); + var cfg = { + tracking: { + + enableDetectionFromFar: true + + } + }; + var instance = new module.Instance(cfg); + instance.start().then(function(){ + console.log('Start camera'); + assert.ok(true); + done(); + }).catch(function(){ + assert.ok(false); + done(); + }); + }); +}); diff --git a/misc/nodeapi-realsense-tests/realsense/trackingOptions/test-trackingOptions-enableFaceLandmarks-false-positive.js b/misc/nodeapi-realsense-tests/realsense/trackingOptions/test-trackingOptions-enableFaceLandmarks-false-positive.js new file mode 100644 index 000000000..128b1cebd --- /dev/null +++ b/misc/nodeapi-realsense-tests/realsense/trackingOptions/test-trackingOptions-enableFaceLandmarks-false-positive.js @@ -0,0 +1,34 @@ +"use strict" +var emitter = require('events').EventEmitter; +const assert = require('assert'); +var module = require('bindings')('realsense_pt'); + +function inherits(target, source) { + for (var k in source.prototype) { + target.prototype[k] = source.prototype[k]; + } +} + +inherits(module.Instance, emitter); + +describe('check enum TrackingOptions', function(done){ + it('checking member of TrackingOptions: '+ "enableFaceLandmarks" + "false", function(done) { + this.timeout(60000); + var cfg = { + tracking: { + + enableFaceLandmarks: false + + } + }; + var instance = new module.Instance(cfg); + instance.start().then(function(){ + console.log('Start camera'); + assert.ok(true); + done(); + }).catch(function(){ + assert.ok(false); + done(); + }); + }); +}); diff --git a/misc/nodeapi-realsense-tests/realsense/trackingOptions/test-trackingOptions-enableFaceLandmarks-true-positive.js b/misc/nodeapi-realsense-tests/realsense/trackingOptions/test-trackingOptions-enableFaceLandmarks-true-positive.js new file mode 100644 index 000000000..fd35deaba --- /dev/null +++ b/misc/nodeapi-realsense-tests/realsense/trackingOptions/test-trackingOptions-enableFaceLandmarks-true-positive.js @@ -0,0 +1,34 @@ +"use strict" +var emitter = require('events').EventEmitter; +const assert = require('assert'); +var module = require('bindings')('realsense_pt'); + +function inherits(target, source) { + for (var k in source.prototype) { + target.prototype[k] = source.prototype[k]; + } +} + +inherits(module.Instance, emitter); + +describe('check enum TrackingOptions', function(done){ + it('checking member of TrackingOptions: '+ "enableFaceLandmarks" + "true", function(done) { + this.timeout(60000); + var cfg = { + tracking: { + + enableFaceLandmarks: true + + } + }; + var instance = new module.Instance(cfg); + instance.start().then(function(){ + console.log('Start camera'); + assert.ok(true); + done(); + }).catch(function(){ + assert.ok(false); + done(); + }); + }); +}); diff --git a/misc/nodeapi-realsense-tests/realsense/trackingOptions/test-trackingOptions-enableHeadBoundingBox-false-positive.js b/misc/nodeapi-realsense-tests/realsense/trackingOptions/test-trackingOptions-enableHeadBoundingBox-false-positive.js new file mode 100644 index 000000000..71e07b0da --- /dev/null +++ b/misc/nodeapi-realsense-tests/realsense/trackingOptions/test-trackingOptions-enableHeadBoundingBox-false-positive.js @@ -0,0 +1,34 @@ +"use strict" +var emitter = require('events').EventEmitter; +const assert = require('assert'); +var module = require('bindings')('realsense_pt'); + +function inherits(target, source) { + for (var k in source.prototype) { + target.prototype[k] = source.prototype[k]; + } +} + +inherits(module.Instance, emitter); + +describe('check enum TrackingOptions', function(done){ + it('checking member of TrackingOptions: '+ "enableHeadBoundingBox" + "false", function(done) { + this.timeout(60000); + var cfg = { + tracking: { + + enableHeadBoundingBox: false + + } + }; + var instance = new module.Instance(cfg); + instance.start().then(function(){ + console.log('Start camera'); + assert.ok(true); + done(); + }).catch(function(){ + assert.ok(false); + done(); + }); + }); +}); diff --git a/misc/nodeapi-realsense-tests/realsense/trackingOptions/test-trackingOptions-enableHeadBoundingBox-true-positive.js b/misc/nodeapi-realsense-tests/realsense/trackingOptions/test-trackingOptions-enableHeadBoundingBox-true-positive.js new file mode 100644 index 000000000..25df33924 --- /dev/null +++ b/misc/nodeapi-realsense-tests/realsense/trackingOptions/test-trackingOptions-enableHeadBoundingBox-true-positive.js @@ -0,0 +1,34 @@ +"use strict" +var emitter = require('events').EventEmitter; +const assert = require('assert'); +var module = require('bindings')('realsense_pt'); + +function inherits(target, source) { + for (var k in source.prototype) { + target.prototype[k] = source.prototype[k]; + } +} + +inherits(module.Instance, emitter); + +describe('check enum TrackingOptions', function(done){ + it('checking member of TrackingOptions: '+ "enableHeadBoundingBox" + "true", function(done) { + this.timeout(60000); + var cfg = { + tracking: { + + enableHeadBoundingBox: true + + } + }; + var instance = new module.Instance(cfg); + instance.start().then(function(){ + console.log('Start camera'); + assert.ok(true); + done(); + }).catch(function(){ + assert.ok(false); + done(); + }); + }); +}); diff --git a/misc/nodeapi-realsense-tests/realsense/trackingOptions/test-trackingOptions-enableHeadPose-false-positive.js b/misc/nodeapi-realsense-tests/realsense/trackingOptions/test-trackingOptions-enableHeadPose-false-positive.js new file mode 100644 index 000000000..3fe7515f5 --- /dev/null +++ b/misc/nodeapi-realsense-tests/realsense/trackingOptions/test-trackingOptions-enableHeadPose-false-positive.js @@ -0,0 +1,34 @@ +"use strict" +var emitter = require('events').EventEmitter; +const assert = require('assert'); +var module = require('bindings')('realsense_pt'); + +function inherits(target, source) { + for (var k in source.prototype) { + target.prototype[k] = source.prototype[k]; + } +} + +inherits(module.Instance, emitter); + +describe('check enum TrackingOptions', function(done){ + it('checking member of TrackingOptions: '+ "enableHeadPose" + "false", function(done) { + this.timeout(60000); + var cfg = { + tracking: { + + enableHeadPose: false + + } + }; + var instance = new module.Instance(cfg); + instance.start().then(function(){ + console.log('Start camera'); + assert.ok(true); + done(); + }).catch(function(){ + assert.ok(false); + done(); + }); + }); +}); diff --git a/misc/nodeapi-realsense-tests/realsense/trackingOptions/test-trackingOptions-enableHeadPose-true-positive.js b/misc/nodeapi-realsense-tests/realsense/trackingOptions/test-trackingOptions-enableHeadPose-true-positive.js new file mode 100644 index 000000000..ff4b91344 --- /dev/null +++ b/misc/nodeapi-realsense-tests/realsense/trackingOptions/test-trackingOptions-enableHeadPose-true-positive.js @@ -0,0 +1,34 @@ +"use strict" +var emitter = require('events').EventEmitter; +const assert = require('assert'); +var module = require('bindings')('realsense_pt'); + +function inherits(target, source) { + for (var k in source.prototype) { + target.prototype[k] = source.prototype[k]; + } +} + +inherits(module.Instance, emitter); + +describe('check enum TrackingOptions', function(done){ + it('checking member of TrackingOptions: '+ "enableHeadPose" + "true", function(done) { + this.timeout(60000); + var cfg = { + tracking: { + + enableHeadPose: true + + } + }; + var instance = new module.Instance(cfg); + instance.start().then(function(){ + console.log('Start camera'); + assert.ok(true); + done(); + }).catch(function(){ + assert.ok(false); + done(); + }); + }); +}); diff --git a/misc/nodeapi-realsense-tests/realsense/trackingOptions/test-trackingOptions-enablePersonOrientation-false-positive.js b/misc/nodeapi-realsense-tests/realsense/trackingOptions/test-trackingOptions-enablePersonOrientation-false-positive.js new file mode 100644 index 000000000..157b91aee --- /dev/null +++ b/misc/nodeapi-realsense-tests/realsense/trackingOptions/test-trackingOptions-enablePersonOrientation-false-positive.js @@ -0,0 +1,34 @@ +"use strict" +var emitter = require('events').EventEmitter; +const assert = require('assert'); +var module = require('bindings')('realsense_pt'); + +function inherits(target, source) { + for (var k in source.prototype) { + target.prototype[k] = source.prototype[k]; + } +} + +inherits(module.Instance, emitter); + +describe('check enum TrackingOptions', function(done){ + it('checking member of TrackingOptions: '+ "enablePersonOrientation" + "false", function(done) { + this.timeout(60000); + var cfg = { + tracking: { + + enablePersonOrientation: false + + } + }; + var instance = new module.Instance(cfg); + instance.start().then(function(){ + console.log('Start camera'); + assert.ok(true); + done(); + }).catch(function(){ + assert.ok(false); + done(); + }); + }); +}); diff --git a/misc/nodeapi-realsense-tests/realsense/trackingOptions/test-trackingOptions-enablePersonOrientation-true-positive.js b/misc/nodeapi-realsense-tests/realsense/trackingOptions/test-trackingOptions-enablePersonOrientation-true-positive.js new file mode 100644 index 000000000..aeca76f3c --- /dev/null +++ b/misc/nodeapi-realsense-tests/realsense/trackingOptions/test-trackingOptions-enablePersonOrientation-true-positive.js @@ -0,0 +1,34 @@ +"use strict" +var emitter = require('events').EventEmitter; +const assert = require('assert'); +var module = require('bindings')('realsense_pt'); + +function inherits(target, source) { + for (var k in source.prototype) { + target.prototype[k] = source.prototype[k]; + } +} + +inherits(module.Instance, emitter); + +describe('check enum TrackingOptions', function(done){ + it('checking member of TrackingOptions: '+ "enablePersonOrientation" + "true", function(done) { + this.timeout(60000); + var cfg = { + tracking: { + + enablePersonOrientation: true + + } + }; + var instance = new module.Instance(cfg); + instance.start().then(function(){ + console.log('Start camera'); + assert.ok(true); + done(); + }).catch(function(){ + assert.ok(false); + done(); + }); + }); +}); diff --git a/misc/nodeapi-realsense-tests/realsense/trackingOptions/test-trackingOptions-enableSegmentation-false-positive.js b/misc/nodeapi-realsense-tests/realsense/trackingOptions/test-trackingOptions-enableSegmentation-false-positive.js new file mode 100644 index 000000000..aa8144e07 --- /dev/null +++ b/misc/nodeapi-realsense-tests/realsense/trackingOptions/test-trackingOptions-enableSegmentation-false-positive.js @@ -0,0 +1,34 @@ +"use strict" +var emitter = require('events').EventEmitter; +const assert = require('assert'); +var module = require('bindings')('realsense_pt'); + +function inherits(target, source) { + for (var k in source.prototype) { + target.prototype[k] = source.prototype[k]; + } +} + +inherits(module.Instance, emitter); + +describe('check enum TrackingOptions', function(done){ + it('checking member of TrackingOptions: '+ "enableSegmentation" + "false", function(done) { + this.timeout(60000); + var cfg = { + tracking: { + + enableSegmentation: false + + } + }; + var instance = new module.Instance(cfg); + instance.start().then(function(){ + console.log('Start camera'); + assert.ok(true); + done(); + }).catch(function(){ + assert.ok(false); + done(); + }); + }); +}); diff --git a/misc/nodeapi-realsense-tests/realsense/trackingOptions/test-trackingOptions-enableSegmentation-true-positive.js b/misc/nodeapi-realsense-tests/realsense/trackingOptions/test-trackingOptions-enableSegmentation-true-positive.js new file mode 100644 index 000000000..a2fdbc426 --- /dev/null +++ b/misc/nodeapi-realsense-tests/realsense/trackingOptions/test-trackingOptions-enableSegmentation-true-positive.js @@ -0,0 +1,34 @@ +"use strict" +var emitter = require('events').EventEmitter; +const assert = require('assert'); +var module = require('bindings')('realsense_pt'); + +function inherits(target, source) { + for (var k in source.prototype) { + target.prototype[k] = source.prototype[k]; + } +} + +inherits(module.Instance, emitter); + +describe('check enum TrackingOptions', function(done){ + it('checking member of TrackingOptions: '+ "enableSegmentation" + "true", function(done) { + this.timeout(60000); + var cfg = { + tracking: { + + enableSegmentation: true + + } + }; + var instance = new module.Instance(cfg); + instance.start().then(function(){ + console.log('Start camera'); + assert.ok(true); + done(); + }).catch(function(){ + assert.ok(false); + done(); + }); + }); +}); diff --git a/misc/nodeapi-realsense-tests/realsense/trackingOptions/test-trackingOptions-maxTrackedPerson-1-positive.js b/misc/nodeapi-realsense-tests/realsense/trackingOptions/test-trackingOptions-maxTrackedPerson-1-positive.js new file mode 100644 index 000000000..0c51362ee --- /dev/null +++ b/misc/nodeapi-realsense-tests/realsense/trackingOptions/test-trackingOptions-maxTrackedPerson-1-positive.js @@ -0,0 +1,34 @@ +"use strict" +var emitter = require('events').EventEmitter; +const assert = require('assert'); +var module = require('bindings')('realsense_pt'); + +function inherits(target, source) { + for (var k in source.prototype) { + target.prototype[k] = source.prototype[k]; + } +} + +inherits(module.Instance, emitter); + +describe('check enum TrackingOptions', function(done){ + it('checking member of TrackingOptions: '+ "maxTrackedPerson" + "1", function(done) { + this.timeout(60000); + var cfg = { + tracking: { + + maxTrackedPerson: 1 + + } + }; + var instance = new module.Instance(cfg); + instance.start().then(function(){ + console.log('Start camera'); + assert.ok(true); + done(); + }).catch(function(){ + assert.ok(false); + done(); + }); + }); +}); diff --git a/misc/nodeapi-realsense-tests/realsense/trackingOptions/test-trackingOptions-maxTrackedPerson-2-positive.js b/misc/nodeapi-realsense-tests/realsense/trackingOptions/test-trackingOptions-maxTrackedPerson-2-positive.js new file mode 100644 index 000000000..ac9e80edb --- /dev/null +++ b/misc/nodeapi-realsense-tests/realsense/trackingOptions/test-trackingOptions-maxTrackedPerson-2-positive.js @@ -0,0 +1,34 @@ +"use strict" +var emitter = require('events').EventEmitter; +const assert = require('assert'); +var module = require('bindings')('realsense_pt'); + +function inherits(target, source) { + for (var k in source.prototype) { + target.prototype[k] = source.prototype[k]; + } +} + +inherits(module.Instance, emitter); + +describe('check enum TrackingOptions', function(done){ + it('checking member of TrackingOptions: '+ "maxTrackedPerson" + "2", function(done) { + this.timeout(60000); + var cfg = { + tracking: { + + maxTrackedPerson: 2 + + } + }; + var instance = new module.Instance(cfg); + instance.start().then(function(){ + console.log('Start camera'); + assert.ok(true); + done(); + }).catch(function(){ + assert.ok(false); + done(); + }); + }); +}); diff --git a/misc/nodeapi-realsense-tests/realsense/trackingOptions/test-trackingOptions-trackingMode-following-positive.js b/misc/nodeapi-realsense-tests/realsense/trackingOptions/test-trackingOptions-trackingMode-following-positive.js new file mode 100644 index 000000000..39f7a1d5a --- /dev/null +++ b/misc/nodeapi-realsense-tests/realsense/trackingOptions/test-trackingOptions-trackingMode-following-positive.js @@ -0,0 +1,34 @@ +"use strict" +var emitter = require('events').EventEmitter; +const assert = require('assert'); +var module = require('bindings')('realsense_pt'); + +function inherits(target, source) { + for (var k in source.prototype) { + target.prototype[k] = source.prototype[k]; + } +} + +inherits(module.Instance, emitter); + +describe('check enum TrackingOptions', function(done){ + it('checking member of TrackingOptions: '+ "trackingMode" + "following", function(done) { + this.timeout(60000); + var cfg = { + tracking: { + + trackingMode: 'following' + + } + }; + var instance = new module.Instance(cfg); + instance.start().then(function(){ + console.log('Start camera'); + assert.ok(true); + done(); + }).catch(function(){ + assert.ok(false); + done(); + }); + }); +}); diff --git a/misc/nodeapi-realsense-tests/realsense/trackingOptions/test-trackingOptions-trackingMode-interactive-positive.js b/misc/nodeapi-realsense-tests/realsense/trackingOptions/test-trackingOptions-trackingMode-interactive-positive.js new file mode 100644 index 000000000..de0249945 --- /dev/null +++ b/misc/nodeapi-realsense-tests/realsense/trackingOptions/test-trackingOptions-trackingMode-interactive-positive.js @@ -0,0 +1,34 @@ +"use strict" +var emitter = require('events').EventEmitter; +const assert = require('assert'); +var module = require('bindings')('realsense_pt'); + +function inherits(target, source) { + for (var k in source.prototype) { + target.prototype[k] = source.prototype[k]; + } +} + +inherits(module.Instance, emitter); + +describe('check enum TrackingOptions', function(done){ + it('checking member of TrackingOptions: '+ "trackingMode" + "interactive", function(done) { + this.timeout(60000); + var cfg = { + tracking: { + + trackingMode: 'interactive' + + } + }; + var instance = new module.Instance(cfg); + instance.start().then(function(){ + console.log('Start camera'); + assert.ok(true); + done(); + }).catch(function(){ + assert.ok(false); + done(); + }); + }); +}); diff --git a/misc/nodeapi-realsense-tests/realsense/trackingOptions/test-trackingOptions-trackingMode-single-person-positive.js b/misc/nodeapi-realsense-tests/realsense/trackingOptions/test-trackingOptions-trackingMode-single-person-positive.js new file mode 100644 index 000000000..ea834f87d --- /dev/null +++ b/misc/nodeapi-realsense-tests/realsense/trackingOptions/test-trackingOptions-trackingMode-single-person-positive.js @@ -0,0 +1,34 @@ +"use strict" +var emitter = require('events').EventEmitter; +const assert = require('assert'); +var module = require('bindings')('realsense_pt'); + +function inherits(target, source) { + for (var k in source.prototype) { + target.prototype[k] = source.prototype[k]; + } +} + +inherits(module.Instance, emitter); + +describe('check enum TrackingOptions', function(done){ + it('checking member of TrackingOptions: '+ "trackingMode" + "single-person", function(done) { + this.timeout(60000); + var cfg = { + tracking: { + + trackingMode: 'single-person' + + } + }; + var instance = new module.Instance(cfg); + instance.start().then(function(){ + console.log('Start camera'); + assert.ok(true); + done(); + }).catch(function(){ + assert.ok(false); + done(); + }); + }); +}); diff --git a/misc/nodeapi-realsense-tests/realsense/util.js b/misc/nodeapi-realsense-tests/realsense/util.js new file mode 100644 index 000000000..b9112b07e --- /dev/null +++ b/misc/nodeapi-realsense-tests/realsense/util.js @@ -0,0 +1,81 @@ +var emitter = require('events').EventEmitter; +function inherits(target, source) { + for (var k in source.prototype) { + target.prototype[k] = source.prototype[k]; + } +} +function getInstance(module, instanceConfig, cameraConfig) { + var module = module; + inherits(module.Instance, emitter); + if (cameraConfig != {}) { + //return new module.Instance(instanceConfig, cameraConfig); + return new module.Instance(instanceConfig); + } else { + return new module.Instance(instanceConfig); + } +} +var getObj = function getObj(module, name, instanceConfig, cameraConfig) { + var m = getInstance(module, instanceConfig, cameraConfig); + m.start().then(function(){console.log('Start camera!');}); + if (name == 'Instance') { + return { + instance: m, + obj: m + } + } + else if (name == 'PersonTracking') { + return { + instance: m, + obj: m.personTracking + } + } + else if (name == 'SkelonArea') { + m.getInstanceConfig.then( + data => { + return { + instance: m, + obj: data.skeleton.traingArea + } + } + ); + } + else if (name == 'LyingPoseInfo') { + m.lyingPoseRecognition.getCandidatesData().then( + data => { + return { + instance: m, + obj: data[0] + } + } + ) + } + else if (name == 'LyingPoseRecognition') { + return { + instance: m, + obj: m.lyingPoseRecognition + } + } + else if (name == 'RecognitionInfo') { + m.faceRecognition.recognizeAll().then( + data => { + return { + instance: m, + obj: data[0] + } + } + ) + } + else if (name == 'FaceRecognition') { + return { + instance: m, + obj: m.faceRecognition + } + } + else if (name == 'PersonTracking') { + return { + instance: m, + obj: m.personTracking + } + } +} +exports.getObj = getObj; diff --git a/misc/nodeapi-realsense-tests/suite.json b/misc/nodeapi-realsense-tests/suite.json new file mode 100644 index 000000000..67a5f12de --- /dev/null +++ b/misc/nodeapi-realsense-tests/suite.json @@ -0,0 +1,27 @@ +{ + "pkg-blacklist": [ + "pack.py", + "testcase.xsl", + "testresult.xsl", + "tests.css", + "icon.png", + "suite.json", + "inst.*" + ], + "pkg-list": { + "iot": { + "blacklist": [ + "*" + ], + "copylist": { + "inst.iot.py": "inst.py", + "tests.full.xml": "tests.full.xml", + "tests.xml": "tests.xml", + "package.json": "package.json", + "nodeAddon": "nodeAddon", + "realsense": "realsense" + } + } + }, + "pkg-name": "nodeapi-realsense-tests" +} diff --git a/misc/nodeapi-realsense-tests/testGen/generate-test-case.js b/misc/nodeapi-realsense-tests/testGen/generate-test-case.js new file mode 100644 index 000000000..83151d773 --- /dev/null +++ b/misc/nodeapi-realsense-tests/testGen/generate-test-case.js @@ -0,0 +1,119 @@ +// Copyright (c) 2016 Intel Corporation. All rights reserved. +// Use of this source code is governed by a MIT-style license that can be +// found in the LICENSE file. + +"use strict"; + +const path = require('path'); +const fs = require("fs.promised"); +const mkdirp = require("mkdirp"); +const glob = require('glob'); + +const webIDL2 = require("webidl2"); +const dot = require("dot"); +dot.templateSettings.strip = false; // Do not remove spaces & linebreaks +const dots = dot.process({path: path.join(__dirname, "templates")}); + +const _writeFile = function(name, text) { + return fs.writeFile(name, text); +}; + +const _packEmptyLines = function(str) { + return str.replace(/\n{3,}/gm, '\n\n').replace(/(\r\n){3,}/gm, '\r\n\r\n'); +}; + +const _parseIDL = function(idlText) { + return webIDL2.parse(idlText); +}; + +const _readFile = function (path) { + return fs.readFile(path); +}; + +function generateTestCase() { + var array = glob.sync(path.join('idl','*')); + array.forEach(file =>{ + var ext = path.parse(file).ext; + if (ext === '.widl') { + _readFile(file) + .then(data => { + var idlTree = _parseIDL(data.toString()); + idlTree.forEach(def => { + def.file_name = path.parse(file).name; + console.log("----start-----"); + console.log(def); + console.log("----end-----"); + if (def.type === 'interface') { + console.log('interface is ' + def.name); + const testText = _packEmptyLines(dots.apiExistence(def)); + const dirName = "realsense"; + mkdirp.sync(dirName); + const fileName = path.join('..', dirName, 'test-' + def.name.toLowerCase() + '-api-existence.js'); + console.log(fileName); + _writeFile(fileName, testText); + } + //else if (def.type === 'enum') { + // const testText = _packEmptyLines(dots.enumExistence(def)); + // const dirName = "realsense"; + // mkdirp.sync(dirName); + // const fileName = path.join('..', dirName, 'test-' + def.name.toLowerCase() + '-enum-existence.js'); + // console.log(fileName); + // _writeFile(fileName, testText); + //} + }); + }) + .catch(e => { + console.log(e); + }); + } + var name = path.parse(file).name; + if (ext === '.json') { + _readFile(file) + .then(data => { + var obj = JSON.parse(data); + var rlt = {} + var index = 1; + for (var i in obj) { + for (var j in obj[i]){ + rlt[index] = {}; + rlt[index]['index'] = index; + rlt[index]['name'] = i; + rlt[index]['type'] = typeof(obj[i][j]); + rlt[index]['value'] = obj[i][j]; + index++; + } + } + //for (var i in obj['enable']) { + // for (var j in obj['maxTrackedPerson']) { + // for (var k in obj['trackingArea']) { + // rlt[index] = {}; + // rlt[index]['index'] = index; + // rlt[index]['values'] = {}; + // rlt[index]['values']['enable'] = obj['enable'][i] + // rlt[index]['values']['maxTrackedPerson'] = obj['maxTrackedPerson'][j] + // rlt[index]['values']['trackingArea'] = obj['trackingArea'][k] + // index++; + // } + // } + //} + for (var i in rlt ) { + var def = rlt[i]; + var index = def['index']; + const testText = _packEmptyLines(dots[name](def)); + const dirName = "realsense"; + mkdirp(path.join('..', dirName, name)); + //const fileName = path.join('..', dirName, name, 'test-' + name + '-positive' + index + '.js'); + const fileName = path.join('..', dirName, name, 'test-' + name + '-' + rlt[i]['name'] +'-'+ rlt[i]['value'] + '-positive.js'); + console.log(fileName); + _writeFile(fileName, testText); + }; + }); + }; + }) +} + +generateTestCase(); + +module.exports = { + generateTestCase: generateTestCase +}; diff --git a/misc/nodeapi-realsense-tests/testGen/idl/pt.widl b/misc/nodeapi-realsense-tests/testGen/idl/pt.widl new file mode 100644 index 000000000..ccac21cc1 --- /dev/null +++ b/misc/nodeapi-realsense-tests/testGen/idl/pt.widl @@ -0,0 +1,365 @@ +////////////// Global config related ////////////// +dictionary InstanceOptions { + SkeletonRecognitionOptions skeleton; + TrackingOptions tracking; + LyingPoseRecognitionOptions lying; + PersonPoseRecognitionOptions pose; + FaceRecognitionOptions face; + GestureRecognitionOptions gesture; + ExpressionRecognitionOptions expression; +}; + +/////////// Skeletion Joint Recognition ////////////////// +//the mode with "rough" postfix means fewer skeleton points are detected. +enum SkeletonArea { + "upper-body", + "upper-body-rough", + "full-body-rough", + "full-body" +}; + +dictionary SkeletonRecognitionOptions { + boolean enable = false; + long maxTrackedPerson = 1; + SkeletonArea trackingArea = "upper-body"; +}; + + +/////////// Tracking ///////////////// +enum DetectionMode { + "auto", + "close-range", + "mid-range", + "far-range", + "full-range" +}; + +dictionary TrackingOptions { + boolean enable = true; + boolean enableSegmentation = false; + boolean enableHeadPose = false; + boolean enableBlob = false; + boolean enablePersonOrientation = false; + boolean enableHeadBoundingBox = true; + boolean enableFaceLandmarks = false; + boolean enableDetectionFromFar = false; + long maxTrackedPerson = 1; + DetectionMode detectMode = "auto"; +}; + +/////////////////// Lying Pose Recognition //////////////////////// +//Person lying is isolated from normal person tracking result as the usage +//is not clear and may perform state change interactive operations during tracking. +enum LyingPoseRecognitionState { + "searching", + "classifing", +}; + +dictionary LyingPoseRecognitionOptions { + boolean enable = false; + long maxTrackedPerson = 1; +}; + +enum ClassificationResult { + "classified", + "need-different-view-point", + "not-classified" +}; + +interface LyingPoseInfo { + attribute PointCombinedInfo position; + attribute BoundingBox2DInfo boundingBox; + attribute ClassificationResult result; + attribute long confidence; +}; + +interface LyingPoseRecognition { + Promise setRecognitionState(LyingPoseRecognitionState state); + Promise getRecognitionState(); + Promise getCandidatesCount(); + Promise getCandidatesData(); +}; + +////////////////// Pose ///////////////////////////////// +dictionary PersonPoseRecognitionOptions { + boolean enable = false; + long maxTrackedPerson = 1; +}; + +/////////////////// Face Regocnition ////////////////// +enum FaceRecognitionPolicy { + "standard", + //"strict" +}; + +//Policy for how to register person to database +enum FaceRegistrationPolicy { +// "automatic", //not support yet +// "manual-override", // not support yet + "manual-add" +}; + +dictionary FaceRecognitionOptions { + boolean enable = false; + FaceRecognitionPolicy policy = "standard"; + boolean useMultiFrame = false; //is multiple frame recognization or single frame. +}; + +interface RecognitionInfo { + attribute long trackID; //track id + attribute long recognitionID; //recognition id + attribute long similarityScore; +}; + +//interface to manipulate recognition +interface FaceRecognition { + Promise> getRegisteredIDs(); + Promise clearDatabase(); + Promise exportDatabase(); + Promise importDatabase(ArrayBuffer buf); + Promise> recognizeAll(); + + //API for specific person + Promise registerPerson(long trackID); //return recognition ID. + Promise unRegisterPerson(long recognitionID); + Promise isPersonRegistered(long recognitionID); + Promise reinforceRegistration(long trackID, long recognitionID, FaceRegistrationPolicy policy); + Promise recognize(long trackID); + //try to recognize a person indicated by trackID and if recognized, get the similarity score with the person indicated by recogID. + Promise querySimilarityScoreByID(long trackID, long recognitionID); +}; + +//////////////// Gesture Recognition ///////////////// + +enum GestureType { + "pointing" +}; + +dictionary GestureRecognitionOptions { + boolean enable = false; + long maxTrackedPerson = 1; //? there is no getMaxTrackedPerson + boolean enableAllGestures = false; + boolean disableAllGestures = false; + boolean enablePointing = true; +}; + +///////////////// Expression Recognition ///////////////// +enum Expression { + "neutral", + "happiness", + "sadness", + "surprise", + "fear", + "anger", + "disgust", + "contempt" +}; + +dictionary ExpressionRecognitionOptions { + boolean enable = false; + long maxTrackedPerson = 1; + boolean enableAllExpressions = false; + boolean disableAllExpressions = false; + boolean enableNeutral = true; + boolean enableHappy = true; + boolean enableSad = false; + boolean enableSurprise = false; + boolean enableFear = false; + boolean enableAnger = false; + boolean enableDisgust = false; + boolean enableContempt = false; +}; + +/////////////// The controller //////////////// + +interface PersonTracking { + Promise startTrackingPerson(long trackID); + Promise stopTrackingPerson(long trackID); +}; + +enum TrackingState { + "not-started", + "tracking", + "detecting", + "stopped" +}; + +[ +Constructor, +Constructor(InstanceOptions options) +//Constructor(InstanceOptions instanceOptions,CameraOptions cameraOptions) +] +interface Instance { + readonly attribute TrackingState state; + + Promise getInstanceOptions(); +// Promise getCameraOptions(); + Promise setInstanceOptions(InstanceOptions instanceOptions); +// Promise setCameraOptions(CameraOptions cameraOptions); + + Promise start(); + Promise stop(); + Promise pause(); + Promise resume(); + Promise reset(); + + readonly attribute FaceRecognition faceRecognition; + readonly attribute LyingPoseRecognition lyingPoseRecognition; + readonly attribute PersonTracking personTracking; + + //Events + //For the persontracked event, the data is PersonTrackingResult + //attribute EventHandler onpersontracked; +}; + +////////////// Result //////////////// + +enum AccessOrder { + "access-order-by-id" +}; + +interface PersonInfo { + readonly attribute SkeletonInfo? skeletonInfo; + readonly attribute TrackingInfo? trackInfo; + readonly attribute GestureInfo? gestureInfo; + readonly attribute ExpressionInfoCollection? expressionInfo; + readonly attribute FaceLandmarkInfo? landmarkInfo; + readonly attribute PoseInfo? poseInfo; +}; + +interface PersonTrackingResult { + readonly attribute PersonInfo[] persons;//ordered by id by default +}; + +enum JointType { + "ankle-left", + "ankle-right", + "elbow-left", + "elbow-right", + "foot-left", + "foot-right", + "hand-left", + "hand-right", + "hand-tip-left", + "hand-tip-right", + "head", + "hip-left", + "hip-right", + "knee-left", + "knee-right", + "neck", + "shoulder-left", + "shoulder-right", + "spine-base", + "spine-mid", + "spine-shoulder", + "thumb-left", + "thumb-right", + "wrist-left", + "wrist-right" +}; + +interface SkeletonPointInfo { + readonly attribute JointType jointType; + readonly attribute Point3D worldCoordinate; + readonly attribute Point2D imageCoordinate; + readonly attribute long worldConfidence; + readonly attribute long imageConfidence; +}; + +interface SkeletonInfo { + readonly attribute SkeletonPointInfo[] skeletonJoints; +}; + +interface BoundingBox2DInfo { + readonly attribute Rect2D rect; + readonly attribute long confidence; +}; + +interface MaskInfo { + readonly attribute long width; + readonly attribute long height; + readonly attribute ArrayBuffer maskData; +}; + +interface PointCombinedInfo { + readonly attribute Point3D worldCoordinate; + readonly attribute Point2D imageCoordinate; + readonly attribute long worldConfidence; + readonly attribute long imageConfidence; +}; + +interface PoseEulerAngles { + readonly attribute float yaw; + readonly attribute float pitch; + readonly attribute float roll; +}; + +enum Orientation { + "frontal", + "45-degree-right", + "45-degree-left", + "profile-right", + "profile-left", + "rear" +}; + +interface OrientationInfo { + readonly attribute Orientation orientType; + readonly attribute long confidence; +}; + +interface TrackingInfo { + readonly attribute long id; + readonly attribute BoundingBox2DInfo boundingBox; + readonly attribute PointCombinedInfo center; + readonly attribute BoundingBox2DInfo? headBoundingBox; + readonly attribute MaskInfo? segmentationMask; + readonly attribute MaskInfo? blobMask; + readonly attribute PoseEulerAngles? headPose; + readonly attribute OrientationInfo? orient; +}; + +interface FaceLandmark { + readonly attribute Point3D imageCoordinate; //todo, use float Point3D + readonly attribute Point3D worldCoordinate; //todo, use float Point3D +}; + +interface FaceLandmarkInfo { + readonly attribute FaceLandmark[] landmarks; + readonly attribute long confidence; +}; + +interface PointingInfo { + readonly attribute Point3D worldOrigin; + readonly attribute Point3D worldDirection; + readonly attribute Point2D imageOrigin; + readonly attribute Point2D imageDirection; + readonly attribute long confidence; + readonly attribute long startTimeStamp; +}; + +interface GestureInfo { + readonly attribute boolean isPointing; + readonly attribute PointingInfo? thePointingInfo; +}; + +interface ExpressionInfo { + readonly attribute Expression type; + readonly attribute long confidence; +}; + +interface ExpressionInfoCollection { + readonly attribute ExpressionInfo[] infoCollection; +}; + +enum PositionType { + "lying-down", + "sitting", + "standing" +}; + +interface PoseInfo { + readonly attribute PositionType position; + readonly attribute long confidence; +}; diff --git a/misc/nodeapi-realsense-tests/testGen/interface_init.js b/misc/nodeapi-realsense-tests/testGen/interface_init.js new file mode 100644 index 000000000..98433905c --- /dev/null +++ b/misc/nodeapi-realsense-tests/testGen/interface_init.js @@ -0,0 +1,7 @@ +exports.newMap = { + 'VRPose': 'VRPose', + 'Meal': 'new addon.meal("adc", 1.0)', + 'DepthMask': 'new adfd.dadf("adddc", "1bbbb1111")', + 'MediaError': 'new ("fdas", "fdas")', + 'TextDecoder': 'new TextDecoder()' + }; diff --git a/misc/nodeapi-realsense-tests/testGen/map.js b/misc/nodeapi-realsense-tests/testGen/map.js new file mode 100644 index 000000000..ee6d96fa5 --- /dev/null +++ b/misc/nodeapi-realsense-tests/testGen/map.js @@ -0,0 +1,12 @@ +exports.mapping = { + TrackingAngle: { + InstanceConfig: 'trackingAngle', // Name of attribute which defined in dictory + Constructor: 'Instance', // Name of Constructor (to init an object) + GetInstance: 'getInstanceConfig' // method name for get dictory. + }, + SkeletonArea: { + InstanceConfig: 'trackingAngle', + Constructor: 'Instance', + GetInstance: 'getInstanceConfig', + } +} diff --git a/misc/nodeapi-realsense-tests/testGen/package.json b/misc/nodeapi-realsense-tests/testGen/package.json new file mode 100644 index 000000000..8511c8983 --- /dev/null +++ b/misc/nodeapi-realsense-tests/testGen/package.json @@ -0,0 +1,23 @@ +{ + "name": "widl-nan", + "version": "0.0.1", + "description": "Generate C++ NAN node-addon by Web IDL", + "author": "Kenny Yuan ", + "license": "SEE LICENSE IN LICENSE", + "dependencies": { + "assert": "^1.4.1", + "bindings": "^1.2.1", + "chai": "^3.5.0", + "commander": "^2.9.0", + "dot": "^1.0.3", + "fs-extra": "^0.30.0", + "fs.promised": "^3.0.0", + "glob": "^7.0.5", + "mkdirp": "^0.5.1", + "mocha": "^2.5.3", + "nan": "^2.3.5", + "npmlog": "^4.0.0", + "rimraf": "^2.5.4", + "webidl2": "^2.0.11" + } +} diff --git a/misc/nodeapi-realsense-tests/testGen/templates/apiExistence.dot b/misc/nodeapi-realsense-tests/testGen/templates/apiExistence.dot new file mode 100644 index 000000000..6a07b4b7e --- /dev/null +++ b/misc/nodeapi-realsense-tests/testGen/templates/apiExistence.dot @@ -0,0 +1,62 @@ +"use strict" +const assert = require('assert'); +var util = require('./util.js'); +var module = require('bindings')('realsense_pt'); + +{{#def.typeConversion}} +{{#def.map}} +{{var info = getInfo(it.name);}} +var instanceConfig = {}; +instanceConfig = {{=info.instanceConfig}}; +var cameraConfig = {{=info.cameraConfig}}; +var instance = util.getObj(module, "{{=it.name}}", instanceConfig, cameraConfig).instance; +var obj = util.getObj(module, "{{=it.name}}", instanceConfig, cameraConfig).obj; +describe('{{=it.name}} API Test', function () { + + describe('API Existance', function() { + it('module.{{=it.name}} is exist', function() { + assert.ok(typeof(obj) !== 'undefined' ) + }); + + it('module.{{=it.name}} type is correct', function() { + assert.equal(typeof(obj),'object'); + }); + + +{{~ it.members :p:i}} + +{{? p.type === 'attribute'}} + it('module.{{=it.name}}() object has the attribute {{=p.name}}', function () { + assert.ok(obj.{{=p.name}} !== undefined ); + }); + it('module.{{=it.name}}() object has the {{=ConvertIDLType2JavaScript(p.idlType)}} attribute {{=p.name}}', function () { + assert.equal(typeof(obj.{{=p.name}}),'{{=ConvertIDLType2JavaScript(p.idlType)}}'); + }); +{{? p.readonly === true}} + it('module.{{=it.name}}() object has the readonly attribute {{=p.name}}', function () { + assert.throws(() => {obj.{{=p.name}} = {{=GetAssignValue(p.idlType)}}}); + }); +{{??}} + it('module.{{=it.name}}() object has the writable attribute {{=p.name}}', function () { + var tmp; + tmp = obj.{{=p.name}}; + obj.{{=p.name}} = {{=GetAssignValue(p.idlType)}}; + assert.notEqual(tmp, obj.{{=p.name}}); + }); +{{?}} +{{?}} + + +{{? p.type === 'operation'}} + + it('new module.{{=it.name}}() object has a method .{{=p.name}}', function () { + assert.equal(typeof(obj.{{=p.name}}), 'function'); + }); + +{{?}} + +{{~}} + + }); + +}); diff --git a/misc/nodeapi-realsense-tests/testGen/templates/enumExistence.dot b/misc/nodeapi-realsense-tests/testGen/templates/enumExistence.dot new file mode 100644 index 000000000..3a8d94988 --- /dev/null +++ b/misc/nodeapi-realsense-tests/testGen/templates/enumExistence.dot @@ -0,0 +1,42 @@ +"use strict" +{{#def.map}} +{{var info = getInfo(it.name);}} +const assert = require('assert'); +var module = require('./pt.js'); +var enum_group = []; +{{~ it.values :p:i}} +enum_group.push("{{=p}}") +{{~}} +enum_group.push('invalid'); + +function _test(i) { + describe('check enum {{=it.name}}', function(){ + it('checking member of {{=it.name}}: '+ enum_group[i], function(done) { + {{? !info}} + TODO: + {{?? info.ppConfig && info.ppConfig != ""}} + var cfg = {} + cfg['{{=info.pConfig}}']['{{=info.ppConfig}}'] = enum_group[i]; + var instance = new module.{{=info.constructor}}(cfg); + instance.{{=info.getInstance}}().then(data => { + assert.equal(data.{{=info.ppConfig}}.{{=info.pConfig}}, enum_group[i]); + done(); + }); + {{?? info.pConfig && info.pConfig != ""}} + var cfg = {} + cfg['{{=info.pConfig}}'] = enum_group[i]; + var instance = new module.{{=info.constructor}}(cfg); + instance.{{=info.getInstance}}().then(data => { + assert.equal(data.{{=info.pConfig}}, enum_group[i]); + done(); + }); + {{??}} + + {{?}} + }); + }); +} + +for (var x in enum_group) { + _test(x); +} diff --git a/misc/nodeapi-realsense-tests/testGen/templates/map.def b/misc/nodeapi-realsense-tests/testGen/templates/map.def new file mode 100644 index 000000000..6dc104b40 --- /dev/null +++ b/misc/nodeapi-realsense-tests/testGen/templates/map.def @@ -0,0 +1,52 @@ +{{ + var LyingPoseInfo= []; + LyingPoseInfo['instanceConfig'] = '{\n + lying: {\n + enable: true,\n + maxTrackedPerson:1\n + }\n}'; + LyingPoseInfo['cameraConfig'] = '{}'; + LyingPoseInfo['instance'] = 'Instance'; + + var LyingPoseRecognition = []; + LyingPoseRecognition = LyingPoseInfo; + + var RecognitionInfo = []; + RecognitionInfo = LyingPoseInfo; + + var FaceRecognition = []; + FaceRecognition = LyingPoseInfo; + + var PersonTracking = []; + PersonTracking = LyingPoseInfo; + + var Instance = []; + Instance = LyingPoseInfo; + + var PersonData = []; + PersonData = LyingPoseInfo; + + var getInfo = function(name){ + if (name == 'LyingPoseInfo'){ + return LyingPoseInfo; + } + else if (name == 'LyingPoseRecognition'){ + return LyingPoseRecognition; + } + else if (name == 'RecognitionInfo'){ + return RecognitionInfo; + } + else if (name == 'FaceRecognition'){ + return FaceRecognition; + } + else if (name == 'PersonTracking'){ + return PersonTracking; + } + else if (name == 'Instance'){ + return Instance; + } + else { + return null; + } + }; +}} diff --git a/misc/nodeapi-realsense-tests/testGen/templates/pt.js b/misc/nodeapi-realsense-tests/testGen/templates/pt.js new file mode 100644 index 000000000..42fac4449 --- /dev/null +++ b/misc/nodeapi-realsense-tests/testGen/templates/pt.js @@ -0,0 +1,23 @@ +// Copyright (c) 2016 Intel Corporation. All rights reserved. +// // Use of this source code is governed by a MIT-style license that can be +// // found in the LICENSE file. +//const webIDL2 = require('webidl2'); +var assert = require('assert'); + +//var idlTree = _readFile(file).then(data => {_parseIDL(data.toString())}); +//var enum_group = + +var PT = require('pt'); +var enum_group = ['frontal', 'profile', 'all',]; //from widl parser +enum_group.push('invild'); +describe('enum name', function(){ + for (var i in enum_group) { + it ('# enum group'+ enum_group[i], function(done){ + var CFG = {trackingAngle: enum_group[i]}; // + var Instance = new PT.Instance(CFG); + Instance.getInstanceConfig().then(data =>{ + assert.equal(data.trackingAngle, enum_group[i])}; + done()); + } + }) +}) diff --git a/misc/nodeapi-realsense-tests/testGen/templates/typeConversion.def b/misc/nodeapi-realsense-tests/testGen/templates/typeConversion.def new file mode 100644 index 000000000..4f3c5d701 --- /dev/null +++ b/misc/nodeapi-realsense-tests/testGen/templates/typeConversion.def @@ -0,0 +1,42 @@ +{{ +var ConvertIDLType2JavaScript = function (idlType) { + var type = idlType.idlType; + if (type === 'String' || type === 'DOMString' || type === 'ByteString' || type === 'USVString') { + type = 'string'; + } + else if (type === 'void') { + type = 'undefined'; + } + else if (type === 'boolean') { + type = 'boolean'; + } + else if (type === 'byte' || type === 'octet' || type === 'unsigned short' || type === 'long' || type === 'unsigned long' || type === 'long long' || type === 'DOMTimeStamp' || type === 'float' || type === 'double' || type === 'unrestricted float' || type === 'unrestricted double') { + type = 'number'; + } + else if (type === 'object') { + type = 'function'; + } + else { + type = 'object'; + } + return type; +}; + +var GetAssignValue = function (idlType, value) { + var newValue; + var type = idlType.idlType; + if (type === 'String' || type === 'DOMString' || type === 'ByteString' || type === 'USVString') { + newValue = value + 'Assign'; + } + else if (type === 'boolean') { + newValue = !value; + } + else if (type === 'byte' || type === 'octet' || type === 'unsigned short' || type === 'long' || type === 'unsigned long' || type === 'long long' || type === 'DOMTimeStamp' || type === 'float' || type === 'double' || type === 'unrestricted float' || type === 'unrestricted double') { + newValue = value + 1; + } + else { + newValue = null; + } + return newValue; +}; +}} diff --git a/misc/nodeapi-realsense-tests/testGen/test-trackingangle-enum-existence.js b/misc/nodeapi-realsense-tests/testGen/test-trackingangle-enum-existence.js new file mode 100644 index 000000000..16c31c057 --- /dev/null +++ b/misc/nodeapi-realsense-tests/testGen/test-trackingangle-enum-existence.js @@ -0,0 +1,35 @@ +"use strict" + +const assert = require('assert'); +var module = require('./pt.js'); +var enum_group = []; + +enum_group.push("frontal") + +enum_group.push("profile") + +enum_group.push("all") + +enum_group.push('invalid'); + +function _test(i) { + describe('check enum TrackingAngle', function(){ + it('checking member of TrackingAngle: '+ enum_group[i], function(done) { + var cfg = {} + + cfg['trackingAngle'] = enum_group[i]; + + var instance = new module.Instance(cfg); + console.log(123); + instance.getInstanceConfig().then(data => { + console.log(data); + assert.equal(data.trackingAngle, enum_group[i]); + done(); + }); + }); + }); +} + +for (var x in enum_group) { + _test(x); +}