mirror of
https://github.com/savoirfairelinux/opendht.git
synced 2026-11-08 04:21:51 +00:00
Value::operator== ignores seq, so a node re-announcing identical content with a bumped seq is the same value refreshed, not an edition. ValueCache must not re-emit it: a source-counting OpValueCache above would count the node twice and keep the value after the node is gone.
68 lines
2.1 KiB
C++
68 lines
2.1 KiB
C++
// Copyright (c) 2014-2026 Savoir-faire Linux Inc.
|
|
// SPDX-License-Identifier: MIT
|
|
#pragma once
|
|
|
|
#include <cppunit/TestFixture.h>
|
|
#include <cppunit/extensions/HelperMacros.h>
|
|
|
|
namespace test {
|
|
|
|
class OpCacheTester : public CppUnit::TestFixture
|
|
{
|
|
CPPUNIT_TEST_SUITE(OpCacheTester);
|
|
CPPUNIT_TEST(testBasicAddExpire);
|
|
CPPUNIT_TEST(testMultipleSources);
|
|
CPPUNIT_TEST(testEditResetsRefCount);
|
|
CPPUNIT_TEST(testEditChainMultiSource);
|
|
CPPUNIT_TEST(testStaleAddIgnored);
|
|
CPPUNIT_TEST(testStaleExpireIgnored);
|
|
CPPUNIT_TEST(testSameSeqConflictExpireIgnored);
|
|
CPPUNIT_TEST(testCallbacks);
|
|
CPPUNIT_TEST(testFilters);
|
|
CPPUNIT_TEST(testSyncStatus);
|
|
CPPUNIT_TEST(testGetWhileSynced);
|
|
CPPUNIT_TEST(testGetWhileNotSynced);
|
|
CPPUNIT_TEST(testGetEmptySynced);
|
|
CPPUNIT_TEST(testGetWithoutCallback);
|
|
CPPUNIT_TEST(testGetCallbackReturnsFalse);
|
|
CPPUNIT_TEST(testTimestampOrdering);
|
|
CPPUNIT_TEST(testSourceDropKeepsValue);
|
|
CPPUNIT_TEST(testSeqOnlyRefreshNotCounted);
|
|
CPPUNIT_TEST(testHighChurnRefCountConsistency);
|
|
CPPUNIT_TEST(testValueUpdateSingleSourcePhantom);
|
|
CPPUNIT_TEST(testExpireAfterUpdate);
|
|
CPPUNIT_TEST(testSingleSourceMode);
|
|
CPPUNIT_TEST(testSingleSourceModeSearchCache);
|
|
CPPUNIT_TEST_SUITE_END();
|
|
|
|
public:
|
|
void setUp();
|
|
void tearDown();
|
|
|
|
void testBasicAddExpire();
|
|
void testMultipleSources();
|
|
void testEditResetsRefCount();
|
|
void testEditChainMultiSource();
|
|
void testStaleAddIgnored();
|
|
void testStaleExpireIgnored();
|
|
void testSameSeqConflictExpireIgnored();
|
|
void testCallbacks();
|
|
void testFilters();
|
|
void testSyncStatus();
|
|
void testGetWhileSynced();
|
|
void testGetWhileNotSynced();
|
|
void testGetEmptySynced();
|
|
void testGetWithoutCallback();
|
|
void testGetCallbackReturnsFalse();
|
|
void testTimestampOrdering();
|
|
void testSourceDropKeepsValue();
|
|
void testSeqOnlyRefreshNotCounted();
|
|
void testHighChurnRefCountConsistency();
|
|
void testValueUpdateSingleSourcePhantom();
|
|
void testExpireAfterUpdate();
|
|
void testSingleSourceMode();
|
|
void testSingleSourceModeSearchCache();
|
|
};
|
|
|
|
} // namespace test
|