Skip to content

Commit 1885b1a

Browse files
committed
add assert for return value
1 parent 84ef834 commit 1885b1a

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/counter.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -747,13 +747,15 @@ void Counter::appmc7_one_measurement_count(
747747
num_hash_list.push_back(0);
748748
num_count_list.push_back(0);
749749
prev_measure = 0;
750+
assert(num_sols == 0 and hash_cnt == 0);
750751
return;
751752
}
752753
if (threshold_sols.find(hash_cnt-1) != threshold_sols.end()
753754
&& threshold_sols[hash_cnt-1] == 1) {
754755
num_hash_list.push_back(hash_cnt-1);
755756
num_count_list.push_back(1);
756757
prev_measure = hash_cnt-1;
758+
assert(num_sols == 0 and threshold_sols[hash_cnt-1] == 1);
757759
return;
758760
}
759761

@@ -784,6 +786,7 @@ void Counter::appmc7_one_measurement_count(
784786
num_hash_list.push_back(hash_cnt);
785787
num_count_list.push_back(1);
786788
prev_measure = hash_cnt;
789+
assert(num_sols == 1 and threshold_sols[hash_cnt+1] == 0);
787790
return;
788791
}
789792

@@ -809,6 +812,7 @@ void Counter::appmc7_one_measurement_count(
809812
}
810813
hash_prev = cur_hash_cnt;
811814
}
815+
assert(false and "This code should never be reached");
812816
}
813817

814818
bool Counter::gen_rhs()

0 commit comments

Comments
 (0)