1
0
Fork 0
mirror of https://github.com/NixOS/nix synced 2025-06-28 09:31:16 +02:00

C API: refactor test support

This commit is contained in:
José Luis Lafuente 2024-02-25 18:14:32 +01:00 committed by José Luis Lafuente
parent 693e8ec8fe
commit 2e1dbbe307
No known key found for this signature in database
GPG key ID: 8A3455EBE455489A
6 changed files with 55 additions and 74 deletions

View file

@ -5,30 +5,12 @@
#include "nix_api_expr.h"
#include "nix_api_value.h"
#include "tests/nix_api_store.hh"
#include "tests/nix_api_expr.hh"
#include <gtest/gtest.h>
namespace nixC {
class nix_api_expr_test : public nix_api_store_test
{
public:
nix_api_expr_test()
{
state = nix_state_create(nullptr, nullptr, store);
value = nix_alloc_value(nullptr, state);
}
~nix_api_expr_test()
{
nix_gc_decref(nullptr, value);
nix_state_free(state);
}
EvalState * state;
Value * value;
};
TEST_F(nix_api_expr_test, nix_expr_eval_from_string)
{
nix_expr_eval_from_string(nullptr, state, "builtins.nixVersion", ".", value);