mirror of
https://github.com/NixOS/nix.git
synced 2025-11-20 17:29:36 +01:00
Separate internal from non-internal unit tests of the C API
This helps us make sure that the external C API is sufficient for the tasks that we think it is sufficient for.
This commit is contained in:
parent
f6bc47bc50
commit
8089102164
10 changed files with 145 additions and 119 deletions
|
|
@ -54,4 +54,12 @@ protected:
|
|||
#define assert_ctx_err() assert_ctx_err(__FILE__, __LINE__)
|
||||
};
|
||||
|
||||
static inline auto createOwnedNixContext()
|
||||
{
|
||||
return std::unique_ptr<nix_c_context, decltype([](nix_c_context * ctx) {
|
||||
if (ctx)
|
||||
nix_c_context_free(ctx);
|
||||
})>(nix_c_context_create(), {});
|
||||
}
|
||||
|
||||
} // namespace nixC
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue