jawaff / KinectController

Control your computer using your body. The KinectController turns the Kinect into a controller that allows configurable actions to be emulated when configurable gestures are triggered by the user.
0 stars 0 forks source link

Unit Test: com.wafflesoft.kinectcontroller.Conversions #41

Open jawaff opened 8 years ago

jawaff commented 8 years ago

Some tests need to be written for the functions in the com.wafflesoft.kinectcontroller.Conversions class.

Note: getKeyId() takes in a string that represents the name of the key of interest (e.g. "escape", "colon", "home".) Note: getKeyId() returns -1 if it can't get a key id.

Tests needed for getKeyId():

  1. Most of the fields defined within the KeyEvent class should be able to be passed to getKeyId() without issue. The fields that do work have a "VK_" prefix (e.g. VK_ESCAPE, VK_COLON, VK_G.) So make sure that all possible inputs for getKeyId() return a number that IS NOT -1 -- -1 is only returned upon failure.
  2. The key argument for getKeyId() is also case insensitive. For example, getKeyId("ESCAPE") and getKeyId("escape") should return the same exact integer value. Verify this with a few different key names.
  3. Also make sure that invalid inputs return -1. So getKeyId("asdfasdf") should return -1.

Note: getJointId() is very similar to getKeyId.

Tests needed for getJointId():

  1. Any of the joint names listed in Nite's JointType enumeration are supported. (Refer to the documentation directory in the KinectController to look at the JointType enumeration.) The first test needs to pass in all possible join names into getJointId() and check to make sure that none of the returned values are -1 -- which means that the input was invalid.
  2. The jointName argument for getJointId() is also case insensitive. For example, getJointId("LEFT_ELBOW") and getJointId("left_elbow") should return the same exact integer value. Verify this with a few different joint names.
  3. Also make sure that invalid inputs return -1. So getJointId("asdfasdf") should return -1.