Commit 681e5c89 authored by Bradley C. Kuszmaul's avatar Bradley C. Kuszmaul

Catch a test that happened to work

git-svn-id: file:///svn/tokudb@75 c7de825b-a66e-492c-adef-691d508d4ae1
parent ca359d9c
...@@ -78,6 +78,7 @@ static void test_pma_find (void) { ...@@ -78,6 +78,7 @@ static void test_pma_find (void) {
pma->N = N; pma->N = N;
for (i=0; i<N; i++) pma->pairs[i].key=0; for (i=0; i<N; i++) pma->pairs[i].key=0;
assert(pma_index_limit(pma)==N); assert(pma_index_limit(pma)==N);
pma->compare_fun = default_compare_fun;
r=pmainternal_find(pma, fill_dbt(&k, "hello", 5), 0); r=pmainternal_find(pma, fill_dbt(&k, "hello", 5), 0);
assert(r==0); assert(r==0);
...@@ -111,16 +112,18 @@ static void test_pma_find (void) { ...@@ -111,16 +112,18 @@ static void test_pma_find (void) {
void test_smooth_region_N (int N) { void test_smooth_region_N (int N) {
struct pair pairs[N]; struct pair pairs[N];
char *strings[100]; char *strings[100];
char string[100]; char string[N];
int i; int i;
int len; int len;
if (N<10) len=1; if (N<10) len=1;
else if (N<100) len=2; else if (N<100) len=2;
else len=8; else len=8;
for (i=0; i<N; i++) { for (i=0; i<N; i++) {
snprintf(string, 10, "%0*d", len, i); snprintf(string, 10, "%0*d", len, i);
strings[i] = strdup(string); strings[i] = strdup(string);
} }
assert(N<30); assert(N<30);
for (i=0; i<(1<<N)-1; i++) { for (i=0; i<(1<<N)-1; i++) {
int insertat; int insertat;
...@@ -158,6 +161,9 @@ void test_smooth_region_N (int N) { ...@@ -158,6 +161,9 @@ void test_smooth_region_N (int N) {
} }
} }
} }
for (i=0; i<N; i++) {
free(strings[i]);
}
} }
......
...@@ -504,9 +504,9 @@ int pma_free (PMA *pmap) { ...@@ -504,9 +504,9 @@ int pma_free (PMA *pmap) {
} }
} }
toku_free(pma->pairs); toku_free(pma->pairs);
toku_free(pma);
if (pma->skey) toku_free(pma->skey); if (pma->skey) toku_free(pma->skey);
if (pma->sval) toku_free(pma->sval); if (pma->sval) toku_free(pma->sval);
toku_free(pma);
*pmap=0; *pmap=0;
return 0; return 0;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment