]> git.proxmox.com Git - libgit2.git/blobdiff - tests/core/structinit.c
New upstream version 1.4.3+dfsg.1
[libgit2.git] / tests / core / structinit.c
index d064f348e375c6648448c1482e670ba09d0e7def..160e2f61218d39b19ede982794149cbbe04571d0 100644 (file)
@@ -1,5 +1,7 @@
 #include "clar_libgit2.h"
+#include <git2/sys/commit_graph.h>
 #include <git2/sys/config.h>
+#include <git2/sys/filter.h>
 #include <git2/sys/odb_backend.h>
 #include <git2/sys/refdb_backend.h>
 #include <git2/sys/transport.h>
@@ -45,9 +47,9 @@ static void options_cmp(void *one, void *two, size_t size, const char *name)
                if (((char *)one)[i] != ((char *)two)[i]) {
                        char desc[1024];
 
-                       p_snprintf(desc, 1024, "Difference in %s at byte %d: macro=%u / func=%u",
+                       p_snprintf(desc, 1024, "Difference in %s at byte %" PRIuZ ": macro=%u / func=%u",
                                name, i, ((char *)one)[i], ((char *)two)[i]);
-                       clar__fail(__FILE__, __LINE__,
+                       clar__fail(__FILE__, __func__, __LINE__,
                                "Difference between macro and function options initializer",
                                desc, 0);
                        return;
@@ -65,56 +67,78 @@ void test_core_structinit__compare(void)
         * which is not guaranteed to be initialized to anything sane at all.
         *
         * Assume most compilers, in a debug build, will clear that memory for
-        * us or set it to sentinal markers.  Etc.
+        * us or set it to sentinel markers.  Etc.
         */
 #if !defined(DEBUG) && !defined(_DEBUG)
        clar__skip();
 #endif
 
+       /* apply */
+       CHECK_MACRO_FUNC_INIT_EQUAL( \
+               git_apply_options, GIT_APPLY_OPTIONS_VERSION, \
+               GIT_APPLY_OPTIONS_INIT, git_apply_options_init);
+
        /* blame */
        CHECK_MACRO_FUNC_INIT_EQUAL( \
                git_blame_options, GIT_BLAME_OPTIONS_VERSION, \
-               GIT_BLAME_OPTIONS_INIT, git_blame_init_options);
+               GIT_BLAME_OPTIONS_INIT, git_blame_options_init);
+
+       /* blob_filter_options */
+       CHECK_MACRO_FUNC_INIT_EQUAL( \
+               git_blob_filter_options, GIT_BLOB_FILTER_OPTIONS_VERSION, \
+               GIT_BLOB_FILTER_OPTIONS_INIT, git_blob_filter_options_init);
 
        /* checkout */
        CHECK_MACRO_FUNC_INIT_EQUAL( \
                git_checkout_options, GIT_CHECKOUT_OPTIONS_VERSION, \
-               GIT_CHECKOUT_OPTIONS_INIT, git_checkout_init_options);
+               GIT_CHECKOUT_OPTIONS_INIT, git_checkout_options_init);
 
        /* clone */
        CHECK_MACRO_FUNC_INIT_EQUAL( \
                git_clone_options, GIT_CLONE_OPTIONS_VERSION, \
-               GIT_CLONE_OPTIONS_INIT, git_clone_init_options);
+               GIT_CLONE_OPTIONS_INIT, git_clone_options_init);
+
+       /* commit_graph_writer */
+       CHECK_MACRO_FUNC_INIT_EQUAL( \
+               git_commit_graph_writer_options, \
+               GIT_COMMIT_GRAPH_WRITER_OPTIONS_VERSION, \
+               GIT_COMMIT_GRAPH_WRITER_OPTIONS_INIT, \
+               git_commit_graph_writer_options_init);
 
        /* diff */
        CHECK_MACRO_FUNC_INIT_EQUAL( \
                git_diff_options, GIT_DIFF_OPTIONS_VERSION, \
-               GIT_DIFF_OPTIONS_INIT, git_diff_init_options);
+               GIT_DIFF_OPTIONS_INIT, git_diff_options_init);
 
        /* diff_find */
        CHECK_MACRO_FUNC_INIT_EQUAL( \
                git_diff_find_options, GIT_DIFF_FIND_OPTIONS_VERSION, \
-               GIT_DIFF_FIND_OPTIONS_INIT, git_diff_find_init_options);
+               GIT_DIFF_FIND_OPTIONS_INIT, git_diff_find_options_init);
+
+       /* filter */
+       CHECK_MACRO_FUNC_INIT_EQUAL( \
+               git_filter, GIT_FILTER_VERSION, \
+               GIT_FILTER_INIT, git_filter_init);
 
        /* merge_file_input */
        CHECK_MACRO_FUNC_INIT_EQUAL( \
                git_merge_file_input, GIT_MERGE_FILE_INPUT_VERSION, \
-               GIT_MERGE_FILE_INPUT_INIT, git_merge_file_init_input);
+               GIT_MERGE_FILE_INPUT_INIT, git_merge_file_input_init);
 
        /* merge_file */
        CHECK_MACRO_FUNC_INIT_EQUAL( \
                git_merge_file_options, GIT_MERGE_FILE_OPTIONS_VERSION, \
-               GIT_MERGE_FILE_OPTIONS_INIT, git_merge_file_init_options);
+               GIT_MERGE_FILE_OPTIONS_INIT, git_merge_file_options_init);
 
        /* merge_tree */
        CHECK_MACRO_FUNC_INIT_EQUAL( \
                git_merge_options, GIT_MERGE_OPTIONS_VERSION, \
-               GIT_MERGE_OPTIONS_INIT, git_merge_init_options);
+               GIT_MERGE_OPTIONS_INIT, git_merge_options_init);
 
        /* push */
        CHECK_MACRO_FUNC_INIT_EQUAL( \
                git_push_options, GIT_PUSH_OPTIONS_VERSION, \
-               GIT_PUSH_OPTIONS_INIT, git_push_init_options);
+               GIT_PUSH_OPTIONS_INIT, git_push_options_init);
 
        /* remote */
        CHECK_MACRO_FUNC_INIT_EQUAL( \
@@ -124,17 +148,22 @@ void test_core_structinit__compare(void)
        /* repository_init */
        CHECK_MACRO_FUNC_INIT_EQUAL( \
                git_repository_init_options, GIT_REPOSITORY_INIT_OPTIONS_VERSION, \
-               GIT_REPOSITORY_INIT_OPTIONS_INIT, git_repository_init_init_options);
+               GIT_REPOSITORY_INIT_OPTIONS_INIT, git_repository_init_options_init);
 
        /* revert */
        CHECK_MACRO_FUNC_INIT_EQUAL( \
                git_revert_options, GIT_REVERT_OPTIONS_VERSION, \
-               GIT_REVERT_OPTIONS_INIT, git_revert_init_options);
+               GIT_REVERT_OPTIONS_INIT, git_revert_options_init);
+
+       /* stash apply */
+       CHECK_MACRO_FUNC_INIT_EQUAL( \
+               git_stash_apply_options, GIT_STASH_APPLY_OPTIONS_VERSION, \
+               GIT_STASH_APPLY_OPTIONS_INIT, git_stash_apply_options_init);
 
        /* status */
        CHECK_MACRO_FUNC_INIT_EQUAL( \
                git_status_options, GIT_STATUS_OPTIONS_VERSION, \
-               GIT_STATUS_OPTIONS_INIT, git_status_init_options);
+               GIT_STATUS_OPTIONS_INIT, git_status_options_init);
 
        /* transport */
        CHECK_MACRO_FUNC_INIT_EQUAL( \
@@ -159,5 +188,14 @@ void test_core_structinit__compare(void)
        /* submodule update */
        CHECK_MACRO_FUNC_INIT_EQUAL( \
                git_submodule_update_options, GIT_SUBMODULE_UPDATE_OPTIONS_VERSION, \
-               GIT_SUBMODULE_UPDATE_OPTIONS_INIT, git_submodule_update_init_options);
+               GIT_SUBMODULE_UPDATE_OPTIONS_INIT, git_submodule_update_options_init);
+
+       /* submodule update */
+       CHECK_MACRO_FUNC_INIT_EQUAL( \
+               git_proxy_options, GIT_PROXY_OPTIONS_VERSION, \
+               GIT_PROXY_OPTIONS_INIT, git_proxy_options_init);
+
+       CHECK_MACRO_FUNC_INIT_EQUAL( \
+               git_diff_patchid_options, GIT_DIFF_PATCHID_OPTIONS_VERSION, \
+               GIT_DIFF_PATCHID_OPTIONS_INIT, git_diff_patchid_options_init);
 }