AVA2 cross-platform client parity baseline

This commit is contained in:
shen
2026-10-06 00:53:42 -07:00
commit 9f748eb05a
3271 changed files with 1275528 additions and 0 deletions
+14
View File
@@ -0,0 +1,14 @@
#include "server_clock.h"
#include <stdexcept>
int main() {
ava2::ServerClock clock(100);
if(clock.milliseconds(150)!=50) throw std::runtime_error("initial elapsed time");
clock.set(1700000000,1000,2000);
if(clock.milliseconds(2500)!=1700001500 || clock.timestamp(2001)!=1700000001)
throw std::runtime_error("AVA2 millisecond/second distinction");
clock.set(1700000000,0xfffffff0U,2000);
if(clock.milliseconds(20)!=1700000036) throw std::runtime_error("DWORD timer wrap");
clock.set(0x7fffffff,100,2000);
if(clock.milliseconds(101)!=static_cast<std::int32_t>(0x80000000U))
throw std::runtime_error("Win32 time_t width");
}