1
1
Fork 0
mirror of https://github.com/NixOS/nix.git synced 2025-12-20 07:51:07 +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:
John Ericson 2025-09-03 16:08:35 -04:00 committed by Jörg Thalheim
parent f6bc47bc50
commit 8089102164
10 changed files with 145 additions and 119 deletions

View file

@ -0,0 +1,25 @@
#include "nix_api_store.h"
#include "nix_api_util.h"
#include "nix_api_expr.h"
#include "nix_api_value.h"
#include "nix_api_expr_internal.h"
#include "nix/expr/tests/nix_api_expr.hh"
#include "nix/util/tests/string_callback.hh"
#include <gmock/gmock.h>
#include <cstddef>
#include <cstdlib>
#include <gtest/gtest.h>
namespace nixC {
TEST_F(nix_api_expr_test, as_nix_value_ptr)
{
// nix_alloc_value casts nix::Value to nix_value
// It should be obvious from the decl that that works, but if it doesn't,
// the whole implementation would be utterly broken.
ASSERT_EQ(sizeof(nix::Value), sizeof(nix_value));
}
} // namespace nixC