mirror of
https://github.com/savoirfairelinux/opendht.git
synced 2026-11-08 04:21:51 +00:00
Add testListenValueEdit to DhtRunnerTester: verifies that editing a value triggers an add callback (not an expire+add), and that the edited value eventually expires. Add testListenValueEdit and testPushListenValueEdit to DhtProxyTester: same semantics tested over the long-poll and push notification proxy paths. Fix proxy tearDown order to destroy DhtProxyServer before shutting down the proxy DhtRunner, preventing use-after-free on cancel.
50 lines
1.4 KiB
C++
50 lines
1.4 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 ValueCacheTester : public CppUnit::TestFixture
|
|
{
|
|
CPPUNIT_TEST_SUITE(ValueCacheTester);
|
|
CPPUNIT_TEST(testUpdate);
|
|
CPPUNIT_TEST(testUpdateExpiration);
|
|
CPPUNIT_TEST(testExpiration);
|
|
CPPUNIT_TEST(testRefresh);
|
|
CPPUNIT_TEST(testExplicitExpiration);
|
|
CPPUNIT_TEST(testClear);
|
|
CPPUNIT_TEST(testSyncStatus);
|
|
CPPUNIT_TEST(testMaxValues);
|
|
CPPUNIT_TEST(testUpdateTypeExpiration);
|
|
CPPUNIT_TEST(testSameSeqEditIgnored);
|
|
CPPUNIT_TEST(testShortExpirationRefreshLost);
|
|
CPPUNIT_TEST(testShortExpirationHighChurn);
|
|
CPPUNIT_TEST(testGracePeriodWhileSynced);
|
|
CPPUNIT_TEST(testUnsyncExpiresImmediately);
|
|
CPPUNIT_TEST_SUITE_END();
|
|
|
|
public:
|
|
void setUp();
|
|
void tearDown();
|
|
|
|
void testUpdate();
|
|
void testUpdateExpiration();
|
|
void testExpiration();
|
|
void testRefresh();
|
|
void testExplicitExpiration();
|
|
void testClear();
|
|
void testSyncStatus();
|
|
void testMaxValues();
|
|
void testUpdateTypeExpiration();
|
|
void testSameSeqEditIgnored();
|
|
void testShortExpirationRefreshLost();
|
|
void testShortExpirationHighChurn();
|
|
void testGracePeriodWhileSynced();
|
|
void testUnsyncExpiresImmediately();
|
|
};
|
|
|
|
} // namespace test
|