X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=tests%2Flibpspp%2Fstringi-set-test.c;h=d7526bbf59da5ca2f2b1adc981dac007d902a10a;hb=339f1956cc727eda788638644ef93ab7852b31cd;hp=74f1ba11e62b6459057573f24d79dd89452b6357;hpb=ff7ae14592cbdbebc4e4322424db95663ea7e166;p=pspp diff --git a/tests/libpspp/stringi-set-test.c b/tests/libpspp/stringi-set-test.c index 74f1ba11e6..d7526bbf59 100644 --- a/tests/libpspp/stringi-set-test.c +++ b/tests/libpspp/stringi-set-test.c @@ -312,7 +312,7 @@ test_insert_any_remove_any (void) for (cnt = 0; cnt <= max_elems; cnt++) { int *insertions, *deletions; - unsigned int ins_perm_cnt; + unsigned int ins_n_perms; int i; insertions = xnmalloc (cnt, sizeof *insertions); @@ -320,24 +320,24 @@ test_insert_any_remove_any (void) for (i = 0; i < cnt; i++) insertions[i] = i; - for (ins_perm_cnt = 0; - ins_perm_cnt == 0 || next_permutation (insertions, cnt); - ins_perm_cnt++) + for (ins_n_perms = 0; + ins_n_perms == 0 || next_permutation (insertions, cnt); + ins_n_perms++) { - unsigned int del_perm_cnt; + unsigned int del_n_perms; int i; for (i = 0; i < cnt; i++) deletions[i] = i; - for (del_perm_cnt = 0; - del_perm_cnt == 0 || next_permutation (deletions, cnt); - del_perm_cnt++) + for (del_n_perms = 0; + del_n_perms == 0 || next_permutation (deletions, cnt); + del_n_perms++) test_insert_delete (insertions, deletions, cnt); - check (del_perm_cnt == factorial (cnt)); + check (del_n_perms == factorial (cnt)); } - check (ins_perm_cnt == factorial (cnt)); + check (ins_n_perms == factorial (cnt)); free (insertions); free (deletions); @@ -355,18 +355,18 @@ test_insert_any_remove_same (void) for (cnt = 0; cnt <= max_elems; cnt++) { int *values; - unsigned int permutation_cnt; + unsigned int n_permutations; int i; values = xnmalloc (cnt, sizeof *values); for (i = 0; i < cnt; i++) values[i] = i; - for (permutation_cnt = 0; - permutation_cnt == 0 || next_permutation (values, cnt); - permutation_cnt++) + for (n_permutations = 0; + n_permutations == 0 || next_permutation (values, cnt); + n_permutations++) test_insert_delete (values, values, cnt); - check (permutation_cnt == factorial (cnt)); + check (n_permutations == factorial (cnt)); free (values); } @@ -384,7 +384,7 @@ test_insert_any_remove_reverse (void) for (cnt = 0; cnt <= max_elems; cnt++) { int *insertions, *deletions; - unsigned int permutation_cnt; + unsigned int n_permutations; int i; insertions = xnmalloc (cnt, sizeof *insertions); @@ -392,16 +392,16 @@ test_insert_any_remove_reverse (void) for (i = 0; i < cnt; i++) insertions[i] = i; - for (permutation_cnt = 0; - permutation_cnt == 0 || next_permutation (insertions, cnt); - permutation_cnt++) + for (n_permutations = 0; + n_permutations == 0 || next_permutation (insertions, cnt); + n_permutations++) { memcpy (deletions, insertions, sizeof *insertions * cnt); reverse (deletions, cnt); test_insert_delete (insertions, deletions, cnt); } - check (permutation_cnt == factorial (cnt)); + check (n_permutations == factorial (cnt)); free (insertions); free (deletions);