Commit 7167422c by nulltoken Committed by Vicent Marti

Refactored some test related constants.

parent 705a90ec
...@@ -90,8 +90,6 @@ BEGIN_TEST("odb", backend_alternates_sorting) ...@@ -90,8 +90,6 @@ BEGIN_TEST("odb", backend_alternates_sorting)
git_odb_close(odb); git_odb_close(odb);
END_TEST END_TEST
#define WORK_TREE_WITHOUT_TRAILING_SLASH TEST_RESOURCES "/temp_working"
#define WORK_TREE_WITH_TRAILING_SLASH WORK_TREE_WITHOUT_TRAILING_SLASH "/"
#define STANDARD_REPOSITORY 0 #define STANDARD_REPOSITORY 0
#define BARE_REPOSITORY 1 #define BARE_REPOSITORY 1
...@@ -118,20 +116,20 @@ static void ensure_repository_init(git_test *_gittest, char *working_directory, ...@@ -118,20 +116,20 @@ static void ensure_repository_init(git_test *_gittest, char *working_directory,
BEGIN_TEST("repo_initialization", init_standard_repo) BEGIN_TEST("repo_initialization", init_standard_repo)
char path_index[GIT_PATH_MAX], path_repository[GIT_PATH_MAX]; char path_index[GIT_PATH_MAX], path_repository[GIT_PATH_MAX];
git__joinpath(path_repository, WORK_TREE_WITH_TRAILING_SLASH, GIT_DIR); git__joinpath(path_repository, TEMP_DIR, GIT_DIR);
git__joinpath(path_index, path_repository, GIT_INDEX_FILE); git__joinpath(path_index, path_repository, GIT_INDEX_FILE);
ensure_repository_init(_gittest, WORK_TREE_WITH_TRAILING_SLASH, STANDARD_REPOSITORY, path_index, path_repository, WORK_TREE_WITH_TRAILING_SLASH); ensure_repository_init(_gittest, TEMP_DIR, STANDARD_REPOSITORY, path_index, path_repository, TEMP_DIR);
ensure_repository_init(_gittest, WORK_TREE_WITHOUT_TRAILING_SLASH, STANDARD_REPOSITORY, path_index, path_repository, WORK_TREE_WITH_TRAILING_SLASH); ensure_repository_init(_gittest, TEMP_DIR_WITHOUT_TRAILING_SLASH, STANDARD_REPOSITORY, path_index, path_repository, TEMP_DIR);
END_TEST END_TEST
BEGIN_TEST("repo_initialization", init_bare_repo) BEGIN_TEST("repo_initialization", init_bare_repo)
char path_repository[GIT_PATH_MAX]; char path_repository[GIT_PATH_MAX];
git__joinpath(path_repository, WORK_TREE_WITH_TRAILING_SLASH, ""); git__joinpath(path_repository, TEMP_DIR, "");
ensure_repository_init(_gittest, WORK_TREE_WITH_TRAILING_SLASH, BARE_REPOSITORY, NULL, path_repository, NULL); ensure_repository_init(_gittest, TEMP_DIR, BARE_REPOSITORY, NULL, path_repository, NULL);
ensure_repository_init(_gittest, WORK_TREE_WITHOUT_TRAILING_SLASH, BARE_REPOSITORY, NULL, path_repository, NULL); ensure_repository_init(_gittest, TEMP_DIR_WITHOUT_TRAILING_SLASH, BARE_REPOSITORY, NULL, path_repository, NULL);
END_TEST END_TEST
git_testsuite *libgit2_suite_repository(void) git_testsuite *libgit2_suite_repository(void)
......
...@@ -29,11 +29,15 @@ ...@@ -29,11 +29,15 @@
#include "test_lib.h" #include "test_lib.h"
#include <git2.h> #include <git2.h>
#define ODB_FOLDER (TEST_RESOURCES "/testrepo.git/objects/") #define TEST_REPOSITORY_NAME "testrepo.git"
#define REPOSITORY_FOLDER (TEST_RESOURCES "/testrepo.git/") #define REPOSITORY_FOLDER TEST_RESOURCES "/" TEST_REPOSITORY_NAME "/"
#define TEST_INDEX_PATH (TEST_RESOURCES "/testrepo.git/index") #define ODB_FOLDER (REPOSITORY_FOLDER "objects/")
#define TEST_INDEX2_PATH (TEST_RESOURCES "/gitgit.index") #define TEST_INDEX_PATH (REPOSITORY_FOLDER "index")
#define TEST_INDEXBIG_PATH (TEST_RESOURCES "/big.index") #define TEST_INDEX2_PATH (TEST_RESOURCES "/gitgit.index")
#define TEST_INDEXBIG_PATH (TEST_RESOURCES "/big.index")
#define TEMP_DIR_WITHOUT_TRAILING_SLASH TEST_RESOURCES "/temp_working"
#define TEMP_DIR TEMP_DIR_WITHOUT_TRAILING_SLASH "/"
typedef struct object_data { typedef struct object_data {
unsigned char *bytes; /* (compressed) bytes stored in object store */ unsigned char *bytes; /* (compressed) bytes stored in object store */
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment