| 108 | }; |
| 109 | |
| 110 | static bool expect_affinity(const std::vector<int>& expected, const char* label) { |
| 111 | std::vector<int> actual; |
| 112 | if (!get_affinity(actual)) { |
| 113 | std::fprintf(stderr, "Linux affinity test: %s: cannot query current affinity\n", label); |
| 114 | return false; |
| 115 | } |
| 116 | if (actual != expected) { |
| 117 | std::fprintf(stderr, "Linux affinity test: %s: expected %zu CPUs, observed %zu\n", |
| 118 | label, expected.size(), actual.size()); |
| 119 | return false; |
| 120 | } |
| 121 | return true; |
| 122 | } |
| 123 | |
| 124 | static bool round_trip_full_mask(const std::vector<int>& allowed) { |
| 125 | const int target = allowed.front(); |
no test coverage detected