MCPcopy Create free account
hub / github.com/cactus-compute/cactus / test_corrupt_weights

Function test_corrupt_weights

tests/test_model_loading.cpp:37–45  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

35}
36
37static bool test_corrupt_weights() {
38 std::string dir = make_temp_dir("corrupt_weights");
39 write_file(dir + "/config.txt", MINIMAL_CONFIG);
40 write_file(dir + "/vocab.txt", "hello\nworld\n");
41 write_file(dir + "/weights.bin", std::string("\xDE\xAD\xBE\xEF", 4) + std::string(124, '\xDE'));
42 bool ok = expect_init_fails(dir);
43 fs::remove_all(dir);
44 return ok;
45}
46
47static bool test_empty_weight_file() {
48 std::string dir = make_temp_dir("empty_weights");

Callers 1

mainFunction · 0.85

Calls 3

write_fileFunction · 0.85
expect_init_failsFunction · 0.85
make_temp_dirFunction · 0.70

Tested by

no test coverage detected