Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
G
git2
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
lvzhengyang
git2
Commits
7167422c
Commit
7167422c
authored
Feb 28, 2011
by
nulltoken
Committed by
Vicent Marti
Mar 03, 2011
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Refactored some test related constants.
parent
705a90ec
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
13 additions
and
11 deletions
+13
-11
tests/t12-repo.c
+6
-8
tests/test_helpers.h
+7
-3
No files found.
tests/t12-repo.c
View file @
7167422c
...
...
@@ -90,8 +90,6 @@ BEGIN_TEST("odb", backend_alternates_sorting)
git_odb_close
(
odb
);
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 BARE_REPOSITORY 1
...
...
@@ -118,20 +116,20 @@ static void ensure_repository_init(git_test *_gittest, char *working_directory,
BEGIN_TEST
(
"repo_initialization"
,
init_standard_repo
)
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
);
ensure_repository_init
(
_gittest
,
WORK_TREE_WITH_TRAILING_SLASH
,
STANDARD_REPOSITORY
,
path_index
,
path_repository
,
WORK_TREE_WITH_TRAILING_SLASH
);
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
,
STANDARD_REPOSITORY
,
path_index
,
path_repository
,
TEMP_DIR
);
ensure_repository_init
(
_gittest
,
TEMP_DIR_WITHOUT_TRAILING_SLASH
,
STANDARD_REPOSITORY
,
path_index
,
path_repository
,
TEMP_DIR
);
END_TEST
BEGIN_TEST
(
"repo_initialization"
,
init_bare_repo
)
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
,
WORK_TREE
_WITHOUT_TRAILING_SLASH
,
BARE_REPOSITORY
,
NULL
,
path_repository
,
NULL
);
ensure_repository_init
(
_gittest
,
TEMP_DIR
,
BARE_REPOSITORY
,
NULL
,
path_repository
,
NULL
);
ensure_repository_init
(
_gittest
,
TEMP_DIR
_WITHOUT_TRAILING_SLASH
,
BARE_REPOSITORY
,
NULL
,
path_repository
,
NULL
);
END_TEST
git_testsuite
*
libgit2_suite_repository
(
void
)
...
...
tests/test_helpers.h
View file @
7167422c
...
...
@@ -29,12 +29,16 @@
#include "test_lib.h"
#include <git2.h>
#define ODB_FOLDER (TEST_RESOURCES "/testrepo.git/objects/")
#define REPOSITORY_FOLDER (TEST_RESOURCES "/testrepo.git/")
#define TEST_INDEX_PATH (TEST_RESOURCES "/testrepo.git/index")
#define TEST_REPOSITORY_NAME "testrepo.git"
#define REPOSITORY_FOLDER TEST_RESOURCES "/" TEST_REPOSITORY_NAME "/"
#define ODB_FOLDER (REPOSITORY_FOLDER "objects/")
#define TEST_INDEX_PATH (REPOSITORY_FOLDER "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
{
unsigned
char
*
bytes
;
/* (compressed) bytes stored in object store */
size_t
blen
;
/* length of data in object store */
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment