Skip to content

Commit 68ed165

Browse files
authored
Merge pull request #235 from joshuaehill/iidReporting
Consistently run both the chi-square independence and chi-square goodness-of-fit tests
2 parents 8fadb3d + 6016199 commit 68ed165

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

cpp/iid/chi_square_tests.h

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -637,6 +637,7 @@ bool chi_square_tests(const uint8_t data[], const int sample_size, const int alp
637637
double score = 0.0;
638638
double pvalue;
639639
int df = 0;
640+
bool result = true;
640641

641642
// Chi Square independence test
642643
if(alphabet_size == 2){
@@ -661,7 +662,7 @@ bool chi_square_tests(const uint8_t data[], const int sample_size, const int alp
661662

662663
// Check result to return if test failed
663664
if(pvalue < 0.001){
664-
return false;
665+
result = false;
665666
}
666667

667668
// Reset score and df
@@ -691,8 +692,8 @@ bool chi_square_tests(const uint8_t data[], const int sample_size, const int alp
691692

692693
// Check result to return if test failed
693694
if(pvalue < 0.001){
694-
return false;
695+
result = false;
695696
}
696697

697-
return true;
698+
return result;
698699
}

0 commit comments

Comments
 (0)