diff --git a/src/tests/cursor-more-than-a-leaf-provdel.c b/src/tests/cursor-more-than-a-leaf-provdel.c index 3f10f44356bda6c30e523789d98107c88f9e5d8c..770a6a23620f1778f65af8aff10ef52f19d65c46 100644 --- a/src/tests/cursor-more-than-a-leaf-provdel.c +++ b/src/tests/cursor-more-than-a-leaf-provdel.c @@ -65,13 +65,28 @@ void doit (BOOL committed_provdels) { r=env->txn_begin(env, 0, &txn, 0); CKERR(r); r = db->cursor(db, txn, &dbc, 0); CKERR(r); } - i=2*num_insert; - j=(i<<1)+37; - r=db->put(db, txn, dbt_init(&key, &i, sizeof(i)), dbt_init(&data, &j, sizeof(j)), DB_YESOVERWRITE); + int ifirst, ilast, jfirst, jlast; + ilast=2*num_insert; + jlast=(ilast<<1)+37; + ifirst=-1*num_insert; + jfirst=(ifirst<<1)+37; + r=db->put(db, txn, dbt_init(&key, &ifirst, sizeof(ifirst)), dbt_init(&data, &jfirst, sizeof(jfirst)), DB_YESOVERWRITE); + CKERR(r); + r=db->put(db, txn, dbt_init(&key, &ilast, sizeof(ilast)), dbt_init(&data, &jlast, sizeof(jlast)), DB_YESOVERWRITE); + CKERR(r); r = dbc->c_get(dbc, dbt_init(&key, NULL, 0), dbt_init(&data, NULL, 0), DB_FIRST); CKERR(r); - assert(*(int*)key.data == i); - assert(*(int*)data.data == j); + assert(*(int*)key.data == ifirst); + assert(*(int*)data.data == jfirst); + r = dbc->c_get(dbc, dbt_init(&key, NULL, 0), dbt_init(&data, NULL, 0), DB_NEXT); CKERR(r); + assert(*(int*)key.data == ilast); + assert(*(int*)data.data == jlast); + r = dbc->c_get(dbc, dbt_init(&key, NULL, 0), dbt_init(&data, NULL, 0), DB_LAST); CKERR(r); + assert(*(int*)key.data == ilast); + assert(*(int*)data.data == jlast); + r = dbc->c_get(dbc, dbt_init(&key, NULL, 0), dbt_init(&data, NULL, 0), DB_PREV); CKERR(r); + assert(*(int*)key.data == ifirst); + assert(*(int*)data.data == jfirst); r = dbc->c_close(dbc); CKERR(r); r=txn->commit(txn, 0); CKERR(r); }