compile fixes + unit tests
This commit is contained in:
parent
e281bc9213
commit
797db3e021
10 changed files with 114 additions and 9 deletions
27
utest/Uniform.test.cpp
Normal file
27
utest/Uniform.test.cpp
Normal file
|
|
@ -0,0 +1,27 @@
|
|||
/* @file Uniform.test.cpp */
|
||||
|
||||
#include "xo/distribution/Uniform.hpp"
|
||||
#include <catch2/catch.hpp>
|
||||
|
||||
namespace xo {
|
||||
using xo::distribution::Uniform;
|
||||
|
||||
namespace ut {
|
||||
TEST_CASE("uniform", "[distribution]") {
|
||||
auto u = Uniform::unit();
|
||||
|
||||
CHECK(u->cdf(-3.0) == 0.0);
|
||||
CHECK(u->cdf(-2.0) == 0.0);
|
||||
CHECK(u->cdf(-1.0) == 0.0);
|
||||
CHECK(u->cdf(0.0) == 0.0);
|
||||
CHECK(u->cdf(0.05) == 0.05);
|
||||
CHECK(u->cdf(0.5) == 0.5);
|
||||
CHECK(u->cdf(0.95) == 0.95);
|
||||
CHECK(u->cdf(1.0) == 1.0);
|
||||
CHECK(u->cdf(2.0) == 1.0);
|
||||
CHECK(u->cdf(3.0) == 1.0);
|
||||
} /*TEST_CASE(uniform)*/
|
||||
} /*namespace ut*/
|
||||
} /*namespace xo*/
|
||||
|
||||
/* end Uniform.test.cpp */
|
||||
Loading…
Add table
Add a link
Reference in a new issue