Main Page
Related Pages
Modules
Namespaces
Classes
Files
File List
File Members
unit-tests
utilities
number
stabilized
test-flickering-value.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 a stabilized value once the inserted value is flickering between 2 values
17
TEST_CASE
(
"update stable value"
,
"[stabilized value]"
)
18
{
19
stabilized_value< float >
stab_value( 10 );
20
21
// Verify flickering value always report the stable value
22
for
(
int
i
= 0;
i
< 100;
i
++ )
23
{
24
stab_value.
add
( 55.0
f
);
25
stab_value.
add
( 60.0
f
);
26
CHECK
( 55.0
f
== stab_value.
get
( 0.7f ) );
27
}
28
}
utilities::number::stabilized_value::add
void add(T val)
Definition:
stabilized-value.h:45
TEST_CASE
TEST_CASE("update stable value","[stabilized value]")
Definition:
test-flickering-value.cpp:17
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
i
int i
Definition:
rs-pcl-color.cpp:54
utilities::number::stabilized_value< float >
CHECK
#define CHECK(condition)
Definition:
easylogging++.h:4483
librealsense2
Author(s): Sergey Dorodnicov
, Doron Hirshberg
, Mark Horn
, Reagan Lopez
, Itay Carpis
autogenerated on Mon May 3 2021 02:50:11