From 27f880c098c684d19df1cea34fe72388d00c9699 Mon Sep 17 00:00:00 2001 From: Robert Hensing Date: Mon, 3 Jun 2024 18:19:37 +0200 Subject: [PATCH] Format after clang-format update --- src/libexpr-c/nix_api_expr.h | 12 +++--- tests/unit/libstore/store-reference.cc | 42 +++++++++---------- .../libutil-support/tests/string_callback.hh | 2 +- 3 files changed, 28 insertions(+), 28 deletions(-) diff --git a/src/libexpr-c/nix_api_expr.h b/src/libexpr-c/nix_api_expr.h index 0d324b148..ede7d099f 100644 --- a/src/libexpr-c/nix_api_expr.h +++ b/src/libexpr-c/nix_api_expr.h @@ -114,12 +114,12 @@ nix_err nix_value_call_multi( * * @see nix_value_call_multi */ -#define NIX_VALUE_CALL(context, state, value, fn, ...) \ - do { \ - Value * args_array[] = {__VA_ARGS__}; \ - size_t nargs = sizeof(args_array) / sizeof(args_array[0]); \ - nix_value_call_multi(context, state, fn, nargs, args_array, value); \ - } while (0) +#define NIX_VALUE_CALL(context, state, value, fn, ...) \ + do { \ + Value * args_array[] = {__VA_ARGS__}; \ + size_t nargs = sizeof(args_array) / sizeof(args_array[0]); \ + nix_value_call_multi(context, state, fn, nargs, args_array, value); \ + } while (0) /** * @brief Forces the evaluation of a Nix value. diff --git a/tests/unit/libstore/store-reference.cc b/tests/unit/libstore/store-reference.cc index 16e033ec4..052cd7bed 100644 --- a/tests/unit/libstore/store-reference.cc +++ b/tests/unit/libstore/store-reference.cc @@ -21,29 +21,29 @@ class StoreReferenceTest : public CharacterizationTest, public LibStoreTest } }; -#define URI_TEST_READ(STEM, OBJ) \ - TEST_F(StoreReferenceTest, PathInfo_##STEM##_from_uri) \ - { \ - readTest(#STEM, ([&](const auto & encoded) { \ - StoreReference expected = OBJ; \ - auto got = StoreReference::parse(encoded); \ - ASSERT_EQ(got, expected); \ - })); \ - } +#define URI_TEST_READ(STEM, OBJ) \ + TEST_F(StoreReferenceTest, PathInfo_##STEM##_from_uri) \ + { \ + readTest(#STEM, ([&](const auto & encoded) { \ + StoreReference expected = OBJ; \ + auto got = StoreReference::parse(encoded); \ + ASSERT_EQ(got, expected); \ + })); \ + } -#define URI_TEST_WRITE(STEM, OBJ) \ - TEST_F(StoreReferenceTest, PathInfo_##STEM##_to_uri) \ - { \ - writeTest( \ - #STEM, \ - [&]() -> StoreReference { return OBJ; }, \ - [](const auto & file) { return StoreReference::parse(readFile(file)); }, \ - [](const auto & file, const auto & got) { return writeFile(file, got.render()); }); \ - } +#define URI_TEST_WRITE(STEM, OBJ) \ + TEST_F(StoreReferenceTest, PathInfo_##STEM##_to_uri) \ + { \ + writeTest( \ + #STEM, \ + [&]() -> StoreReference { return OBJ; }, \ + [](const auto & file) { return StoreReference::parse(readFile(file)); }, \ + [](const auto & file, const auto & got) { return writeFile(file, got.render()); }); \ + } -#define URI_TEST(STEM, OBJ) \ - URI_TEST_READ(STEM, OBJ) \ - URI_TEST_WRITE(STEM, OBJ) +#define URI_TEST(STEM, OBJ) \ + URI_TEST_READ(STEM, OBJ) \ + URI_TEST_WRITE(STEM, OBJ) URI_TEST( auto, diff --git a/tests/unit/libutil-support/tests/string_callback.hh b/tests/unit/libutil-support/tests/string_callback.hh index 3a3e545e9..a02ea3a1b 100644 --- a/tests/unit/libutil-support/tests/string_callback.hh +++ b/tests/unit/libutil-support/tests/string_callback.hh @@ -11,6 +11,6 @@ inline void * observe_string_cb_data(std::string & out) }; #define OBSERVE_STRING(str) \ - (nix_get_string_callback) nix::testing::observe_string_cb, nix::testing::observe_string_cb_data(str) + (nix_get_string_callback) nix::testing::observe_string_cb, nix::testing::observe_string_cb_data(str) }