mirror of
https://github.com/isar/libmdbx.git
synced 2025-02-22 01:48:13 +08:00
mdbx-testing: подавление параноидальных предупреждений MSVC в extra-тестах.
This commit is contained in:
parent
14a55ee244
commit
202cdbc4be
@ -64,7 +64,7 @@ static mdbx::slice mk(mdbx::default_buffer &buf, unsigned min, unsigned max) {
|
|||||||
unsigned len = (min < max) ? min + prng_fast(seed) % (max - min) : min;
|
unsigned len = (min < max) ? min + prng_fast(seed) % (max - min) : min;
|
||||||
buf.clear_and_reserve(len);
|
buf.clear_and_reserve(len);
|
||||||
for (unsigned i = 0; i < len; ++i)
|
for (unsigned i = 0; i < len; ++i)
|
||||||
buf.append_byte(prng_fast(seed));
|
buf.append_byte(mdbx::byte(prng_fast(seed)));
|
||||||
return buf.slice();
|
return buf.slice();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -112,28 +112,30 @@ static void chunched_delete(mdbx::txn txn, const acase &thecase,
|
|||||||
{
|
{
|
||||||
auto cursor = txn.open_cursor(map);
|
auto cursor = txn.open_cursor(map);
|
||||||
while (true) {
|
while (true) {
|
||||||
const unsigned all = cursor.txn().get_map_stat(cursor.map()).ms_entries;
|
const auto all = cursor.txn().get_map_stat(cursor.map()).ms_entries;
|
||||||
// printf("== seek random of %u\n", all);
|
// printf("== seek random of %u\n", all);
|
||||||
|
|
||||||
const char *last_op;
|
const char *last_op;
|
||||||
bool last_r;
|
bool last_r;
|
||||||
|
|
||||||
if ((last_op = "MDBX_GET_BOTH",
|
if (true == ((last_op = "MDBX_GET_BOTH"),
|
||||||
last_r = cursor.find_multivalue(mk_key(k, thecase),
|
(last_r = cursor.find_multivalue(
|
||||||
mk_val(v, thecase), false)) ||
|
mk_key(k, thecase), mk_val(v, thecase), false))) ||
|
||||||
rnd() % 3 == 0 ||
|
rnd() % 3 == 0 ||
|
||||||
(last_op = "MDBX_SET_RANGE",
|
true == ((last_op = "MDBX_SET_RANGE"),
|
||||||
last_r = cursor.lower_bound(mk_key(k, thecase), false))) {
|
(last_r = cursor.lower_bound(mk_key(k, thecase), false)))) {
|
||||||
int i = int(rnd() % 7) - 3;
|
int i = int(rnd() % 7) - 3;
|
||||||
// if (i)
|
// if (i)
|
||||||
// printf(" %s -> %s\n", last_op, last_r ? "true" : "false");
|
// printf(" %s -> %s\n", last_op, last_r ? "true" : "false");
|
||||||
// printf("== shift multi %i\n", i);
|
// printf("== shift multi %i\n", i);
|
||||||
try {
|
try {
|
||||||
while (i < 0 && (last_op = "MDBX_PREV_DUP",
|
while (i < 0 &&
|
||||||
last_r = cursor.to_current_prev_multi(false)))
|
true == ((last_op = "MDBX_PREV_DUP"),
|
||||||
|
(last_r = cursor.to_current_prev_multi(false))))
|
||||||
++i;
|
++i;
|
||||||
while (i > 0 && (last_op = "MDBX_NEXT_DUP",
|
while (i > 0 &&
|
||||||
last_r = cursor.to_current_next_multi(false)))
|
true == ((last_op = "MDBX_NEXT_DUP"),
|
||||||
|
(last_r = cursor.to_current_next_multi(false))))
|
||||||
--i;
|
--i;
|
||||||
} catch (const mdbx::no_data &) {
|
} catch (const mdbx::no_data &) {
|
||||||
printf("cursor_del() -> exception, last %s %s\n", last_op,
|
printf("cursor_del() -> exception, last %s %s\n", last_op,
|
||||||
|
@ -17,7 +17,7 @@ static buffer random(size_t length) {
|
|||||||
buffer result(length);
|
buffer result(length);
|
||||||
#if defined(__cpp_lib_span) && __cpp_lib_span >= 202002L
|
#if defined(__cpp_lib_span) && __cpp_lib_span >= 202002L
|
||||||
for (auto &i : result.bytes())
|
for (auto &i : result.bytes())
|
||||||
i = prng();
|
i = mdbx::byte(prng());
|
||||||
#else
|
#else
|
||||||
for (auto p = result.byte_ptr(); p < result.end_byte_ptr(); ++p)
|
for (auto p = result.byte_ptr(); p < result.end_byte_ptr(); ++p)
|
||||||
*p = mdbx::byte(prng());
|
*p = mdbx::byte(prng());
|
||||||
|
Loading…
x
Reference in New Issue
Block a user