summaryrefslogtreecommitdiffstats
path: root/searchcore/src/tests/proton/server/memory_flush_config_updater
diff options
context:
space:
mode:
authorHenning Baldersheim <balder@yahoo-inc.com>2021-06-23 13:20:53 +0000
committerHenning Baldersheim <balder@yahoo-inc.com>2021-06-23 13:20:53 +0000
commitc62cacfcf3092ebb3cb473574d793015e27a3a71 (patch)
treec5f71726e34f35809378b13b92e0da48747fe3c4 /searchcore/src/tests/proton/server/memory_flush_config_updater
parente348c1c325e0f92d7e638a80e67ba4027b950347 (diff)
Only log when config actually changes.
Diffstat (limited to 'searchcore/src/tests/proton/server/memory_flush_config_updater')
-rw-r--r--searchcore/src/tests/proton/server/memory_flush_config_updater/memory_flush_config_updater_test.cpp29
1 files changed, 29 insertions, 0 deletions
diff --git a/searchcore/src/tests/proton/server/memory_flush_config_updater/memory_flush_config_updater_test.cpp b/searchcore/src/tests/proton/server/memory_flush_config_updater/memory_flush_config_updater_test.cpp
index f918ebe9179..0e06e5d28ed 100644
--- a/searchcore/src/tests/proton/server/memory_flush_config_updater/memory_flush_config_updater_test.cpp
+++ b/searchcore/src/tests/proton/server/memory_flush_config_updater/memory_flush_config_updater_test.cpp
@@ -75,6 +75,35 @@ TEST_F("require that strategy is updated when setting new config", Fixture)
TEST_DO(f.assertStrategyConfig(6, 3, 30));
}
+TEST("require that MemoryFlush::Config equal is correct") {
+ MemoryFlush::Config a, b;
+ EXPECT_TRUE(a.equal(b) && b.equal(a));
+ a.maxGlobalMemory = 7;
+ EXPECT_FALSE(a.equal(b) || b.equal(a));
+ b.maxGlobalMemory = 7;
+ EXPECT_TRUE(a.equal(b) && b.equal(a));
+ a.maxMemoryGain = 8;
+ EXPECT_FALSE(a.equal(b) || b.equal(a));
+ b.maxMemoryGain = 8;
+ EXPECT_TRUE(a.equal(b) && b.equal(a));
+ a.maxGlobalTlsSize = 9;
+ EXPECT_FALSE(a.equal(b) || b.equal(a));
+ b.maxGlobalTlsSize = 9;
+ EXPECT_TRUE(a.equal(b) && b.equal(a));
+ a.maxTimeGain = 10us;
+ EXPECT_FALSE(a.equal(b) || b.equal(a));
+ b.maxTimeGain = 10us;
+ EXPECT_TRUE(a.equal(b) && b.equal(a));
+ a.globalDiskBloatFactor = 11;
+ EXPECT_FALSE(a.equal(b) || b.equal(a));
+ b.globalDiskBloatFactor = 11;
+ EXPECT_TRUE(a.equal(b) && b.equal(a));
+ a.diskBloatFactor = 12;
+ EXPECT_FALSE(a.equal(b) || b.equal(a));
+ b.diskBloatFactor = 12;
+ EXPECT_TRUE(a.equal(b) && b.equal(a));
+}
+
TEST("require that we use configured memory limits") {
auto cfg = MemoryFlushConfigUpdater::convertConfig(getConfig(6, 3, 30), defaultMemory);
EXPECT_EQUAL(cfg.maxGlobalMemory, 6u);