test-illegal-input.cpp
Go to the documentation of this file.
1 // License: Apache 2.0. See LICENSE file in root directory.
2 // Copyright(c) 2020 Intel Corporation. All Rights Reserved.
3 
4 //#cmake:add-file ../../../../common/utilities/number/stabilized-value.h
5 
6 
7 #include "../../../test.h"
8 #include <../common/utilities/number/stabilized-value.h>
9 
10 using namespace utilities::number;
11 
12 // Test group description:
13 // * This tests group verifies stabilized_value class.
14 //
15 // Current test description:
16 // * Verify stabilized_value percentage input is at range (0-100] % (zero not included)
17 TEST_CASE( "Illegal input - percentage value too high", "[stabilized value]" )
18 {
19  stabilized_value< float > stab_value( 5 );
20  stab_value.add( 55.f );
21  CHECK_THROWS( stab_value.get( 1.1f ) );
22  CHECK_THROWS( stab_value.get( -1.1f ) );
23  CHECK_THROWS( stab_value.get( 0.0f ) );
24 }
GLdouble f
T get(float stabilization_percent=0.75f) const
#define CHECK_THROWS(...)
Definition: catch.hpp:17415
TEST_CASE("Illegal input - percentage value too high","[stabilized value]")


librealsense2
Author(s): Sergey Dorodnicov , Doron Hirshberg , Mark Horn , Reagan Lopez , Itay Carpis
autogenerated on Mon May 3 2021 02:50:11