From 956cf40b9dbf98398fe4ba98e369889d435b4298 Mon Sep 17 00:00:00 2001 From: MooZ Date: Sun, 8 Sep 2024 14:52:54 +0200 Subject: [PATCH] Fix build --- .github/workflows/build.yml | 17 +++++++---------- test/comment.c | 9 ++++++++- 2 files changed, 15 insertions(+), 11 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 500be77..8bc7896 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -17,21 +17,18 @@ jobs: - name: Setup Dependencies run: | sudo apt install -y -qq libjansson-dev - - - name: Create Build Environment - run: cmake -E make_directory ${{github.workspace}}/build - - name: Configure CMake + - name: Configure shell: bash - working-directory: ${{github.workspace}}/build - run: cmake $GITHUB_WORKSPACE -DCMAKE_BUILD_TYPE=$BUILD_TYPE + working-directory: ${{github.workspace}} + run: cmake -Bbuild -S . -DCMAKE_BUILD_TYPE=$BUILD_TYPE - name: Build - working-directory: ${{github.workspace}}/build + working-directory: ${{github.workspace}} shell: bash - run: cmake --build . --config $BUILD_TYPE + run: cmake --build ./build --config $BUILD_TYPE - name: Test - working-directory: ${{github.workspace}}/build + working-directory: ${{github.workspace}} shell: bash - run: ctest -C $BUILD_TYPE + run: cmake --build ./build --target test diff --git a/test/comment.c b/test/comment.c index 352712c..b73a1f8 100644 --- a/test/comment.c +++ b/test/comment.c @@ -112,7 +112,14 @@ MunitResult comment_load_test(const MunitParameter params[] __attribute__((unuse munit_assert_int(comment_repository_size(repository), ==, 0); munit_assert_false(comment_repository_load(repository, "data/comment_1.json")); - munit_assert_int(comment_repository_size(repository), ==, 0); + munit_assert_int(comment_repository_size(repository), ==, 1); + + munit_assert_true(comment_repository_get(repository, 0, &comment)); + munit_assert_uint16(comment.logical, ==, 0xCAFEU); + munit_assert_uint8(comment.page, ==, 0x0AU); + munit_assert_string_equal(comment.text, "hello!"); + + comment_repository_destroy(repository); munit_assert_true(comment_repository_load(repository, "data/comment_0.json")); munit_assert_int(comment_repository_size(repository), ==, 2);