Triforce v0.2.0

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
ruckus7382sfgsgdf
2026-11-10 19:32:48 -06:00
commit 34b3683441
1730 changed files with 554853 additions and 0 deletions

15
tests/test_gpu_choice.cpp Normal file
View File

@@ -0,0 +1,15 @@
#include "../gpu/vk/gpu_choice.h"
#include <cstdio>
#define CHECK(name, condition) do { if (!(condition)) { std::fprintf(stderr, "FAIL %s at line %d\n", name, __LINE__); return 1; } } while (0)
int main() {
using mkwvk::gpu_choice::menu_device;
CHECK("Auto stays Auto", menu_device(0, 2) == -1);
CHECK("the n-th usable GPU", menu_device(1, 2) == 0 && menu_device(2, 2) == 1);
CHECK("a GPU taken out since is Auto", menu_device(2, 1) == -1);
CHECK("a negative choice (a hand-edited ini) is Auto", menu_device(-1, 2) == -1);
CHECK("no usable GPU: Auto", menu_device(1, 0) == -1);
std::puts("gpu choice: all checks passed");
}