runtime: encapsulate checkpoint progress state
Some checks failed
build / Linux asan (push) Has been cancelled
build / Linux release (push) Has been cancelled
build / FreeBSD build (push) Has been cancelled

This commit is contained in:
server
2026-04-14 07:12:27 +02:00
parent 3272537376
commit cecc822777
5 changed files with 68 additions and 8 deletions

View File

@@ -10,6 +10,7 @@
#include "game/stdafx.h"
#include "game/SecureCipher.h"
#include "libthecore/fdwatch.h"
#include "libthecore/signal.h"
namespace
{
@@ -309,6 +310,19 @@ void TestFdwatchBackendMetadata()
fdwatch_delete(fdw);
}
void TestCheckpointBackendMetadata()
{
#ifdef OS_WINDOWS
Expect(signal_checkpoint_backend() == CHECKPOINT_BACKEND_NONE, "Expected no checkpoint backend on Windows");
Expect(std::strcmp(signal_checkpoint_backend_name(signal_checkpoint_backend()), "none") == 0,
"Unexpected checkpoint backend name on Windows");
#else
Expect(signal_checkpoint_backend() == CHECKPOINT_BACKEND_VIRTUAL_TIMER, "Expected virtual timer checkpoint backend");
Expect(std::strcmp(signal_checkpoint_backend_name(signal_checkpoint_backend()), "virtual-timer") == 0,
"Unexpected checkpoint backend name");
#endif
}
void TestFdwatchSlotReuseAfterDelete()
{
int sockets_a[2] = { -1, -1 };
@@ -358,6 +372,7 @@ int main()
TestSecureCipherRoundTrip();
TestSocketAuthWireFlow();
TestFdwatchBackendMetadata();
TestCheckpointBackendMetadata();
TestFdwatchReadAndOneshotWrite();
TestFdwatchSlotReuseAfterDelete();
std::cout << "metin smoke tests passed\n";