Commit 6e767f89 authored by Marcin Siodelski's avatar Marcin Siodelski

[master] Do not use std::rand in long response unit test.

It gives unpredictable results on OpenBSD. Okayed on jabber.
parent ea5e0056
......@@ -371,13 +371,10 @@ public:
/// can catch out of order delivery.
static ConstElementPtr longResponseHandler(const std::string&,
const ConstElementPtr&) {
// By seeding the generator with the constant value we will always
// get the same sequence of generated strings.
std::srand(1);
ElementPtr arguments = Element::createList();
for (unsigned i = 0; i < 40000; ++i) {
for (unsigned i = 0; i < 80000; ++i) {
std::ostringstream s;
s << std::setw(10) << std::rand();
s << std::setw(5) << i;
arguments->add(Element::create(s.str()));
}
return (createAnswer(0, arguments));
......
......@@ -380,13 +380,10 @@ public:
/// can catch out of order delivery.
static ConstElementPtr longResponseHandler(const std::string&,
const ConstElementPtr&) {
// By seeding the generator with the constant value we will always
// get the same sequence of generated strings.
std::srand(1);
ElementPtr arguments = Element::createList();
for (unsigned i = 0; i < 40000; ++i) {
for (unsigned i = 0; i < 80000; ++i) {
std::ostringstream s;
s << std::setw(10) << std::rand();
s << std::setw(5) << i;
arguments->add(Element::create(s.str()));
}
return (createAnswer(0, arguments));
......
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