unit-tests-live-r200.cpp
Go to the documentation of this file.
00001 // License: Apache 2.0. See LICENSE file in root directory.
00002 // Copyright(c) 2015 Intel Corporation. All Rights Reserved.
00003 
00005 // This set of tests is valid only for the R200 camera //
00007 
00008 #if !defined(MAKEFILE) || ( defined(LIVE_TEST) && defined(R200_TEST) )
00009 
00010 #include "catch/catch.hpp"
00011 #include "unit-tests-live-ds-common.h"
00012 
00013 #include <climits>
00014 #include <sstream>
00015 
00017 // Streaming tests //
00019 
00020 TEST_CASE("R200 device-unique options support", "[live] [DS-device]")
00021 {
00022     // Require at least one device to be plugged in
00023     safe_context ctx;
00024     const int device_count = rs_get_device_count(ctx, require_no_error());
00025     REQUIRE(device_count > 0);
00026 
00027     // For each device
00028     for (int i = 0; i<device_count; ++i)
00029     {
00030         rs_device * dev = rs_get_device(ctx, 0, require_no_error());
00031         REQUIRE(dev != nullptr);
00032         REQUIRE(ds_names[Intel_R200] == rs_get_device_name(dev, require_no_error()));
00033 
00034         // Prerequisite for the following options list
00035         rs_set_device_option(dev, RS_OPTION_R200_LR_AUTO_EXPOSURE_ENABLED, 1.0, require_no_error());
00036 
00037         const int supported_options[] = {
00038             RS_OPTION_R200_AUTO_EXPOSURE_BRIGHT_RATIO_SET_POINT,
00039             RS_OPTION_R200_AUTO_EXPOSURE_KP_GAIN,
00040             RS_OPTION_R200_AUTO_EXPOSURE_KP_EXPOSURE,
00041             RS_OPTION_R200_AUTO_EXPOSURE_KP_DARK_THRESHOLD,
00042         };
00043 
00044         std::stringstream ss;
00045         for (auto opt : supported_options)
00046         {
00047             ss.str(""); ss << "Verifying support for R200-specific: " << rs_option_to_string((rs_option)i);
00048             REQUIRE(rs_device_supports_option(dev, (rs_option)i, require_no_error()) == 1);
00049         }
00050     }
00051 }
00052 
00053 TEST_CASE( "R200 streams HD Raw10", "[live] [r200] [one-camera]" )
00054 {
00055     test_ds_device_streaming({{RS_STREAM_COLOR, 1920, 1080, RS_FORMAT_RAW10, 30}});
00056 }
00057 
00058 //TEST_CASE("R200 Testing RGB Exposure values", "[live] [DS-device] [one-camera]")
00059 //{
00060 //    // The logarithmic range is [-13:1:-4]
00061 //    test_ds_device_option(RS_OPTION_COLOR_EXPOSURE, { -13, -9, -4, -6, -10 }, {}, BEFORE_START_DEVICE | AFTER_START_DEVICE);
00062 //}
00063 
00064 #endif /* !defined(MAKEFILE) || ( defined(LIVE_TEST) && defined(R200_TEST) ) */


librealsense
Author(s): Sergey Dorodnicov , Mark Horn , Reagan Lopez
autogenerated on Tue Jun 25 2019 19:54:39