Beispiel #1
0
void verifyZeroWalk(const IBSTuple &tuple, Stats &stat) {
    if (stat.count() == 1) {
	verifyWalk(tuple, stat);
    } else {
	SINVARIANT(stat.count() == 0);
	int32_t v = tuple.get<0>();
	SINVARIANT(v >= 0 && v < 10);
	SINVARIANT(tuple.get<1>() != ((v % 2) == 0) ||
		   tuple.get<2>() != str(boost::format("%d") % (v * 10)));
    }
}
Beispiel #2
0
void verifyWalk(const IBSTuple &tuple, Stats &stat) {
    int32_t v = tuple.get<0>();
    SINVARIANT(v >= 0 && v < 10);
    SINVARIANT(!vw_seen[v]);
    SINVARIANT(tuple.get<1>() == ((v % 2) == 0));
    SINVARIANT(tuple.get<2>() == str(boost::format("%d") % (v * 10)));
    SINVARIANT(stat.count() == 1);
    SINVARIANT(stat.mean() == v*5);
    vw_seen[v] = true;
}