summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/test/isolation/isolationtester.c20
-rw-r--r--src/test/isolation/specscanner.l8
2 files changed, 19 insertions, 9 deletions
diff --git a/src/test/isolation/isolationtester.c b/src/test/isolation/isolationtester.c
index 03a9d4a648d..24429de2b03 100644
--- a/src/test/isolation/isolationtester.c
+++ b/src/test/isolation/isolationtester.c
@@ -56,8 +56,8 @@ static int64 max_step_wait = 300 * USECS_PER_SEC;
static void check_testspec(TestSpec *testspec);
static void run_testspec(TestSpec *testspec);
static void run_all_permutations(TestSpec *testspec);
-static void run_all_permutations_recurse(TestSpec *testspec, int nsteps,
- PermutationStep **steps);
+static void run_all_permutations_recurse(TestSpec *testspec, int *piles,
+ int nsteps, PermutationStep **steps);
static void run_named_permutations(TestSpec *testspec);
static void run_permutation(TestSpec *testspec, int nsteps,
PermutationStep **steps);
@@ -368,9 +368,9 @@ check_testspec(TestSpec *testspec)
fprintf(stderr, "unused step name: %s\n", allsteps[i]->name);
}
}
-}
-static int *piles;
+ free(allsteps);
+}
/*
* Run the permutations specified in the spec, or all if none were
@@ -395,6 +395,7 @@ run_all_permutations(TestSpec *testspec)
int i;
PermutationStep *steps;
PermutationStep **stepptrs;
+ int *piles;
/* Count the total number of steps in all sessions */
nsteps = 0;
@@ -420,11 +421,16 @@ run_all_permutations(TestSpec *testspec)
for (i = 0; i < testspec->nsessions; i++)
piles[i] = 0;
- run_all_permutations_recurse(testspec, 0, stepptrs);
+ run_all_permutations_recurse(testspec, piles, 0, stepptrs);
+
+ free(steps);
+ free(stepptrs);
+ free(piles);
}
static void
-run_all_permutations_recurse(TestSpec *testspec, int nsteps, PermutationStep **steps)
+run_all_permutations_recurse(TestSpec *testspec, int *piles,
+ int nsteps, PermutationStep **steps)
{
int i;
bool found = false;
@@ -446,7 +452,7 @@ run_all_permutations_recurse(TestSpec *testspec, int nsteps, PermutationStep **s
piles[i]++;
- run_all_permutations_recurse(testspec, nsteps + 1, steps);
+ run_all_permutations_recurse(testspec, piles, nsteps + 1, steps);
piles[i]--;
diff --git a/src/test/isolation/specscanner.l b/src/test/isolation/specscanner.l
index ebfaacadfac..83d172cdd66 100644
--- a/src/test/isolation/specscanner.l
+++ b/src/test/isolation/specscanner.l
@@ -50,8 +50,12 @@ self [,()*]
%%
%{
- litbuf = pg_malloc(LITBUF_INIT);
- litbufsize = LITBUF_INIT;
+ /* Allocate litbuf in first call of yylex() */
+ if (litbuf == NULL)
+ {
+ litbuf = pg_malloc(LITBUF_INIT);
+ litbufsize = LITBUF_INIT;
+ }
%}
/* Keywords (must appear before the {identifier} rule!) */