summaryrefslogtreecommitdiff
path: root/src/test/isolation/isolationtester.c
diff options
context:
space:
mode:
authorTom Lane2012-01-28 22:55:08 +0000
committerTom Lane2012-01-28 22:55:08 +0000
commit759d9d67695783f6d04a85aba383a41c5382548c (patch)
tree5bef015457c560676acc8b7e335603b3f98d537d /src/test/isolation/isolationtester.c
parent7c1719bc68ec1c347e7c80c3735bf3373e765f35 (diff)
Add simple tests of EvalPlanQual using the isolationtester infrastructure.
Much more could be done here, but at least now we have *some* automated test coverage of that mechanism. In particular this tests the writable-CTE case reported by Phil Sorber. In passing, remove isolationtester's arbitrary restriction on the number of steps in a permutation list. I used this so that a single spec file could be used to run several related test scenarios, but there are other possible reasons to want a step series that's not exactly a permutation. Improve documentation and fix a couple other nits as well.
Diffstat (limited to 'src/test/isolation/isolationtester.c')
-rw-r--r--src/test/isolation/isolationtester.c17
1 files changed, 8 insertions, 9 deletions
diff --git a/src/test/isolation/isolationtester.c b/src/test/isolation/isolationtester.c
index ab1ef036045..0e681639ba1 100644
--- a/src/test/isolation/isolationtester.c
+++ b/src/test/isolation/isolationtester.c
@@ -395,15 +395,9 @@ run_named_permutations(TestSpec * testspec)
Permutation *p = testspec->permutations[i];
Step **steps;
- if (p->nsteps != nallsteps)
- {
- fprintf(stderr, "invalid number of steps in permutation %d\n", i + 1);
- exit_nicely();
- }
-
steps = malloc(p->nsteps * sizeof(Step *));
- /* Find all the named steps from the lookup table */
+ /* Find all the named steps using the lookup table */
for (j = 0; j < p->nsteps; j++)
{
Step **this = (Step **) bsearch(p->stepnames[j], allsteps,
@@ -418,7 +412,9 @@ run_named_permutations(TestSpec * testspec)
steps[j] = *this;
}
+ /* And run them */
run_permutation(testspec, p->nsteps, steps);
+
free(steps);
}
}
@@ -483,6 +479,8 @@ report_two_error_messages(Step *step1, Step *step2)
free(step2->errormsg);
step2->errormsg = NULL;
}
+
+ free(prefix);
}
/*
@@ -700,7 +698,7 @@ try_complete_step(Step *step, int flags)
FD_ZERO(&read_set);
- while (flags & STEP_NONBLOCK && PQisBusy(conn))
+ while ((flags & STEP_NONBLOCK) && PQisBusy(conn))
{
FD_SET(sock, &read_set);
timeout.tv_sec = 0;
@@ -739,7 +737,8 @@ try_complete_step(Step *step, int flags)
}
else if (!PQconsumeInput(conn)) /* select(): data available */
{
- fprintf(stderr, "PQconsumeInput failed: %s", PQerrorMessage(conn));
+ fprintf(stderr, "PQconsumeInput failed: %s\n",
+ PQerrorMessage(conn));
exit_nicely();
}
}