Main Page
Related Pages
Modules
Namespaces
Classes
Files
File List
File Members
unit-tests
utilities
number
stabilized
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
}
utilities::number::stabilized_value::add
void add(T val)
Definition:
stabilized-value.h:45
utilities::number
Definition:
stabilized-value.h:11
f
GLdouble f
Definition:
glad/glad/glad.h:1518
utilities::number::stabilized_value::get
T get(float stabilization_percent=0.75f) const
Definition:
stabilized-value.h:63
CHECK_THROWS
#define CHECK_THROWS(...)
Definition:
catch.hpp:17415
TEST_CASE
TEST_CASE("Illegal input - percentage value too high","[stabilized value]")
Definition:
test-illegal-input.cpp:17
utilities::number::stabilized_value< float >
librealsense2
Author(s): Sergey Dorodnicov
, Doron Hirshberg
, Mark Horn
, Reagan Lopez
, Itay Carpis
autogenerated on Mon May 3 2021 02:50:11