version 1.0.0-rc.21
This commit is contained in:
@@ -37,6 +37,26 @@ TEST_CASE("StatusVector_GetMeanPerBin","[StatusVector]") {
|
||||
REQUIRE(status_out[2600] == 41);
|
||||
}
|
||||
|
||||
|
||||
TEST_CASE("StatusVector_Mean","[StatusVector]") {
|
||||
StatusVector<float> status_vector;
|
||||
status_vector.AddElement(5, 0.045f);
|
||||
|
||||
status_vector.AddElement(2000, .010f);
|
||||
status_vector.AddElement(2543, 0.076f);
|
||||
status_vector.AddElement(2600, 0.011f);
|
||||
|
||||
REQUIRE(status_vector.Mean() == Catch::Approx((0.045+0.010+0.076+0.011)/4.0));
|
||||
}
|
||||
|
||||
TEST_CASE("StatusVector_Mean_LargeNum","[StatusVector]") {
|
||||
StatusVector<float> status_vector;
|
||||
for (int i = 0; i < 100000; i++)
|
||||
status_vector.AddElement(i, 0.045f);
|
||||
|
||||
REQUIRE(status_vector.Mean() == Catch::Approx(0.045));
|
||||
}
|
||||
|
||||
TEST_CASE("StatusVector_GetMaxPerBin","[StatusVector]") {
|
||||
StatusVector<uint64_t> status_vector;
|
||||
status_vector.AddElement(5, 11);
|
||||
|
||||
Reference in New Issue
Block a user