1
0
Fork 0
mirror of https://github.com/NixOS/nix synced 2025-07-07 18:31:49 +02:00

libexpr-c: Add nix_string_realise

This commit is contained in:
Robert Hensing 2024-04-05 16:08:18 +02:00
parent 62f8d8c9a9
commit 02c41aba5b
7 changed files with 235 additions and 10 deletions

View file

@ -23,5 +23,15 @@ protected:
}
nix_c_context * ctx;
inline void assert_ctx_ok() {
if (nix_err_code(ctx) == NIX_OK) {
return;
}
unsigned int n;
const char * p = nix_err_msg(nullptr, ctx, &n);
std::string msg(p, n);
FAIL() << "nix_err_code(ctx) != NIX_OK, message: " << msg;
}
};
}