mirror of
https://github.com/Gnucash/gnucash.git
synced 2025-02-25 18:55:30 -06:00
[-Wunused-function] - remove commented out reduce_tests() and dependents
This commit is contained in:
parent
f702709422
commit
05975aa510
@ -1645,101 +1645,6 @@ cover_tuples( state *s)
|
|||||||
my_free((char *)curr_test);
|
my_free((char *)curr_test);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
|
||||||
prepare_reduce( state *s)
|
|
||||||
{
|
|
||||||
feature tuple[MAX_N];
|
|
||||||
ub1 n = s->n_final;
|
|
||||||
ub4 t, d;
|
|
||||||
|
|
||||||
for (t=0; t<s->ntests; ++t) {
|
|
||||||
for (d=0; d<s->ndim; ++d) {
|
|
||||||
s->onec[t][d] = 0;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/* Iterate through all the tuples */
|
|
||||||
start_builder( s, tuple, n);
|
|
||||||
|
|
||||||
for (;;) {
|
|
||||||
sb4 i;
|
|
||||||
ub2 thistest;
|
|
||||||
|
|
||||||
for (i=0; i<n; ++i) {
|
|
||||||
s->tuple_tester->f[tuple[i].d] = tuple[i].f;
|
|
||||||
}
|
|
||||||
if (count_withouts(s->tuple_tester, s->wc2) ||
|
|
||||||
count_withouts(s->tuple_tester, s->wc3))
|
|
||||||
goto make_next_tuple;
|
|
||||||
|
|
||||||
for (i=0; i<s->ntests; ++i) {
|
|
||||||
ub1 j;
|
|
||||||
for (j=0; j<n; ++j)
|
|
||||||
if (s->t[i]->f[tuple[j].d] != tuple[j].f)
|
|
||||||
break;
|
|
||||||
if (j == n)
|
|
||||||
break; /* this test contains this tuple */
|
|
||||||
}
|
|
||||||
|
|
||||||
/* no tests cover this tuple */
|
|
||||||
if (i==s->ntests) {
|
|
||||||
printf("error: some tuple not covered at all\n");
|
|
||||||
} else {
|
|
||||||
thistest = i;
|
|
||||||
for (++i; i<s->ntests; ++i) {
|
|
||||||
ub1 j;
|
|
||||||
for (j=0; j<n; ++j)
|
|
||||||
if (s->t[i]->f[tuple[j].d] != tuple[j].f)
|
|
||||||
break;
|
|
||||||
if (j == n)
|
|
||||||
break; /* this test contains this tuple */
|
|
||||||
}
|
|
||||||
if (i == s->ntests) {
|
|
||||||
ub1 j;
|
|
||||||
for (j=0; j<n; ++j) {
|
|
||||||
tu_iter ctx;
|
|
||||||
(void)start_tuple(&ctx, &s->one[thistest][tuple[j].d], n,
|
|
||||||
&s->onec[thistest][tuple[j].d]);
|
|
||||||
(void)insert_tuple(s, &ctx, tuple);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
make_next_tuple:
|
|
||||||
for (i=0; i<n; ++i) {
|
|
||||||
s->tuple_tester->f[tuple[i].d] = (ub2)~0;
|
|
||||||
}
|
|
||||||
if (!next_builder( s, tuple, n))
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/* find a test to try to eliminate */
|
|
||||||
static int
|
|
||||||
which_test( state *s)
|
|
||||||
{
|
|
||||||
ub4 t;
|
|
||||||
ub4 mincount = ~0;
|
|
||||||
ub4 mint = 0; /* test with the fewest once-covered tuples */
|
|
||||||
for (t=0; t<s->ntests; ++t) {
|
|
||||||
ub4 i, j=0;
|
|
||||||
for (i=0; i<s->ndim; ++i) {
|
|
||||||
j += s->onec[t][i];
|
|
||||||
}
|
|
||||||
if (j <= mincount) {
|
|
||||||
mincount = j;
|
|
||||||
mint = t;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return mint;
|
|
||||||
}
|
|
||||||
|
|
||||||
static void
|
|
||||||
reduce_tests( state *s)
|
|
||||||
{
|
|
||||||
prepare_reduce( s);
|
|
||||||
}
|
|
||||||
|
|
||||||
/* Confirm that every tuple is covered by either a testcase or a without */
|
/* Confirm that every tuple is covered by either a testcase or a without */
|
||||||
static int
|
static int
|
||||||
confirm( state *s)
|
confirm( state *s)
|
||||||
@ -1818,7 +1723,6 @@ driver( int argc, char *argv[])
|
|||||||
|
|
||||||
if (parse(argc, argv, &s)) { /* read the user's instructions */
|
if (parse(argc, argv, &s)) { /* read the user's instructions */
|
||||||
cover_tuples(&s); /* generate testcases until all tuples are covered */
|
cover_tuples(&s); /* generate testcases until all tuples are covered */
|
||||||
/* reduce_tests(&s); */ /* try to reduce the number of testcases */
|
|
||||||
if (confirm(&s)) /* doublecheck that all tuples really are covered */
|
if (confirm(&s)) /* doublecheck that all tuples really are covered */
|
||||||
report_all(&s); /* report the results */
|
report_all(&s); /* report the results */
|
||||||
else
|
else
|
||||||
|
Loading…
Reference in New Issue
Block a user