| 35 | } |
| 36 | |
| 37 | static 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 | |
| 47 | static bool test_empty_weight_file() { |
| 48 | std::string dir = make_temp_dir("empty_weights"); |
no test coverage detected