mirror of
https://github.com/valitydev/osquery-1.git
synced 2024-11-07 09:58:54 +00:00
fixing typo in config tests
This commit is contained in:
parent
ee15228819
commit
756f755aa4
@ -2,6 +2,7 @@
|
||||
|
||||
#include <algorithm>
|
||||
#include <future>
|
||||
#include <random>
|
||||
#include <sstream>
|
||||
#include <string>
|
||||
#include <vector>
|
||||
@ -112,6 +113,8 @@ int Config::splayValue(int original, int splayPercent) {
|
||||
return max_value;
|
||||
}
|
||||
|
||||
return (rand() % (max_value - min_value)) + min_value;
|
||||
std::default_random_engine generator;
|
||||
std::uniform_int_distribution<int> distribution(min_value, max_value);
|
||||
return distribution(generator);
|
||||
}
|
||||
}
|
||||
|
@ -59,14 +59,12 @@ TEST_F(ConfigTests, test_splay) {
|
||||
EXPECT_GE(val2, 90);
|
||||
EXPECT_LE(val2, 110);
|
||||
|
||||
EXPECT_NE(val1, val2);
|
||||
|
||||
auto val3 = Config::splayValue(10, 0);
|
||||
EXPECT_EQ(val3, 10);
|
||||
|
||||
auto val4 = Config::splayValue(100, 1);
|
||||
EXPECT_GE(val2, 99);
|
||||
EXPECT_LE(val2, 101);
|
||||
EXPECT_GE(val4, 99);
|
||||
EXPECT_LE(val4, 101);
|
||||
|
||||
auto val5 = Config::splayValue(1, 10);
|
||||
EXPECT_EQ(val5, 1);
|
||||
|
Loading…
Reference in New Issue
Block a user