| 1291 | } |
| 1292 | |
| 1293 | void assertThat(bool valid, string msg, const char* func) { |
| 1294 | |
| 1295 | // skip validation if user has disabled |
| 1296 | if (!global_isValidationEnabled) |
| 1297 | return; |
| 1298 | |
| 1299 | // this function does not seek consensus among nodes in distributed |
| 1300 | // settings in order to remain cheap (consensus requires expensive sync |
| 1301 | // and comm), so is suitable for validation which is gauranteed to be |
| 1302 | // uniform between nodes (assuming user's do not hack in rank-specific |
| 1303 | // arguments to the API!) |
| 1304 | |
| 1305 | // invoke the potentially user-overriden error function |
| 1306 | if (!valid) |
| 1307 | global_inputErrorHandler(func, msg.c_str()); |
| 1308 | } |
| 1309 | void assertThat(bool valid, string msg, tokenSubs vars, const char* func) { |
| 1310 | |
| 1311 | // substitute the vars into the error message ONLY if the error message |
no test coverage detected