Skip to content

Qwen3.8-Flash-Next on any consumer hardware: one-click install for Windows / Linux. Strata inference engine, OpenAI/Anthropic API on localhost, optional image input.

C++

test: require a real physical-memory sample on Windows

midhatn6adb2e5ac470
diff --git a/src/core/conversation_memory_test.cpp b/src/core/conversation_memory_test.cpp
index aec678f34..a8cb25d4e 100644
--- a/src/core/conversation_memory_test.cpp
+++ b/src/core/conversation_memory_test.cpp
@@ -5,6 +5,13 @@
#include <limits>
#include <sstream>
+#if defined(_WIN32)
+#ifndef NOMINMAX
+#define NOMINMAX
+#endif
+#include <windows.h>
+#endif
+
using namespace strata::core;
namespace {
int checks = 0;
@@ -45,5 +52,15 @@ int main() {
// Test the real provider without assuming any particular amount of free RAM.
const auto available = conversation_available_memory();
check(!available || conversation_memory_admit(available, 0, 0), "provider returns bytes or unknown");
+#if defined(_WIN32)
+ // Unknown must fail closed in production, but must not let a broken Windows provider pass this test.
+ // Compare with total physical memory, not a second available reading: other processes can allocate
+ // between calls. No pressure allocation or fixed free-memory assumption is needed.
+ MEMORYSTATUSEX physical{};
+ physical.dwLength = sizeof physical;
+ check(GlobalMemoryStatusEx(&physical) != 0, "Windows physical-memory API is available");
+ check(available.has_value() && *available <= physical.ullTotalPhys,
+ "Windows provider returns a known, physically bounded sample");
+#endif
std::printf("conversation_memory_test: %d checks passed\n", checks);
}