TestUniformDistribution.cpp 472 Bytes
Newer Older
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
TEST_F(TestNormalDistribution, TestUniformlyDistributedRandomNumber) {
    double z1, z2;
    for (int i = 0; i < testSamples; i++) {
        rnm->DrawUniformRandomNumbers(z1, z2);
        rns.push_back(z1);
        rns.push_back(z1);
    }
    ASSERT_NEAR(0.5, calc_mean(rns), 1e-2);
    ASSERT_NEAR(0.08333333333333333, calc_var(rns), 1e-2);
}

int main(int argc, char **argv) {
    MppTest mppTest = MppTestBuilder(argc, argv);
    return mppTest.RUN_ALL_MPP_TESTS();
}