116 | | int tc = 0; |
117 | | Array<vec> actual ( CurrentContext::max_trial_count ); |
118 | | do { |
119 | | vec emu = num_mean2 ( hepdf.get(), xb, yb, nbins ( 0 ), nbins ( 1 ) ); |
120 | | actual ( tc ) = emu; |
121 | | ++tc; |
122 | | } while ( ( tc < CurrentContext::max_trial_count ) && |
123 | | !UnitTest::AreClose ( mean, actual ( tc - 1 ), tolerance ) ); |
124 | | if ( ( tc == CurrentContext::max_trial_count ) && |
125 | | ( !UnitTest::AreClose ( mean, actual ( CurrentContext::max_trial_count - 1 ), tolerance ) ) ) { |
126 | | UnitTest::MemoryOutStream stream; |
127 | | stream << CurrentContext::format_context ( __LINE__ ) << "expected " << mean << " +/- " << tolerance << " but was " << actual; |
128 | | |
129 | | UnitTest::TestDetails details ( *UnitTest::CurrentTest::Details(), 0, false ); |
130 | | |
131 | | UnitTest::CurrentTest::Results()->OnTestFailure ( details, stream.GetText() ); |
132 | | } |
| 118 | vec actual; |
| 119 | actual = num_mean2 ( hepdf.get(), xb, yb, nbins ( 0 ), nbins ( 1 ) ); |
| 120 | |
| 121 | CHECK_CLOSE(mean, actual, tolerance); |
139 | | int tc = 0; |
140 | | Array<double> actual ( CurrentContext::max_trial_count ); |
141 | | do { |
142 | | double nc = normcoef ( hepdf.get(), xb, yb, nbins ( 0 ), nbins ( 1 ) ); |
143 | | actual ( tc ) = nc; |
144 | | ++tc; |
145 | | } while ( ( tc < CurrentContext::max_trial_count ) && |
146 | | !UnitTest::AreClose ( 1.0, actual ( tc - 1 ), tolerance ) ); |
147 | | if ( ( tc == CurrentContext::max_trial_count ) && |
148 | | ( !UnitTest::AreClose ( 1.0, actual ( CurrentContext::max_trial_count - 1 ), tolerance ) ) ) { |
149 | | UnitTest::MemoryOutStream stream; |
150 | | stream << CurrentContext::format_context ( __LINE__ ) << "expected " << mean << " +/- " << tolerance << " but was " << actual; |
151 | | |
152 | | UnitTest::TestDetails details ( *UnitTest::CurrentTest::Details(), 0, false ); |
153 | | |
154 | | UnitTest::CurrentTest::Results()->OnTestFailure ( details, stream.GetText() ); |
155 | | } |
| 128 | double nc = normcoef ( hepdf.get(), xb, yb, nbins ( 0 ), nbins ( 1 ) ); |
| 129 | CHECK_CLOSE(1.0,nc,0.01); |