mirror of
https://github.com/NixOS/nix
synced 2025-07-08 11:03:54 +02:00
C API: add tests for libutil and libstore
This commit is contained in:
parent
46f5d0ee7b
commit
41f1669dea
6 changed files with 133 additions and 25 deletions
25
tests/unit/libutil-support/tests/nix_api_util.hh
Normal file
25
tests/unit/libutil-support/tests/nix_api_util.hh
Normal file
|
@ -0,0 +1,25 @@
|
|||
#pragma once
|
||||
///@file
|
||||
#include "nix_api_util.h"
|
||||
|
||||
#include <gtest/gtest.h>
|
||||
|
||||
|
||||
class nix_api_util_context : public ::testing::Test
|
||||
{
|
||||
protected:
|
||||
static void SetUpTestSuite()
|
||||
{
|
||||
nix_libutil_init(NULL);
|
||||
}
|
||||
void SetUp() override
|
||||
{
|
||||
ctx = nix_c_context_create();
|
||||
};
|
||||
void TearDown() override
|
||||
{
|
||||
nix_c_context_free(ctx);
|
||||
ctx = nullptr;
|
||||
}
|
||||
nix_c_context * ctx;
|
||||
};
|
Loading…
Add table
Add a link
Reference in a new issue