Files
AetherForge/agent/config/adapt_test.go
drjones 4341121652 Add adaptive agent identity, self-healing, stealth, and parallel RandomX.
Each install gets a unique agent ID, hardware-aware thread tuning, watchdog persistence, optional stealth mode, multi-engine RAM mining, and a fully static Windows binary with no runtime dependencies.
2026-05-26 23:46:46 -07:00

25 lines
618 B
Go

package config
import (
"testing"
"crypto-miner-agent/stats"
)
func TestAdaptToSystemCapsThreadsByRAM(t *testing.T) {
reporter := stats.NewReporter()
cfg := RuntimeConfig{BuiltinConfig: BuiltinConfig{
ThreadMode: "fixed",
Threads: 16,
MaxMemoryPct: 50,
AdaptToHardware: true,
MinFreeRAM: 999999,
}}
// Without real Windows memory APIs in test env, AdaptToSystem may no-op on totalMB=0.
adapted := cfg.AdaptToSystem(reporter)
if adapted.Threads != cfg.Threads && reporter.TotalMemoryMB() == 0 {
t.Fatalf("unexpected thread change without memory info: %d", adapted.Threads)
}
}