summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPatrick Steinhardt <ps@pks.im>2018-11-23 20:02:31 +0100
committerPatrick Steinhardt <ps@pks.im>2018-11-28 15:22:27 +0100
commit2521e11ce2b9b848735e89a545fc6521e45b13fc (patch)
tree7afbfb841af33640420773f22158ee005dc1d13e
parentf2f5ec844d96fe0007a47e4df00499ab5598b41f (diff)
downloadlibgit2-2521e11ce2b9b848735e89a545fc6521e45b13fc.tar.gz
tests: mailmap: avoid definition of unused static variables
The mailmap testdata header contains a set of static variable definitions. As these variables aren't used in all places where they are used, they trigger the unused-const-variable warnings. As we have currently disabled those warnings explicitly, they are never triggered, but we intend to enable them. Avoid the issue by only keeping variable definitions that are actually used in all locations. Move the others to where they are used.
-rw-r--r--tests/mailmap/mailmap_testdata.h23
-rw-r--r--tests/mailmap/parsing.c23
2 files changed, 23 insertions, 23 deletions
diff --git a/tests/mailmap/mailmap_testdata.h b/tests/mailmap/mailmap_testdata.h
index 173536dd0..a06606b4b 100644
--- a/tests/mailmap/mailmap_testdata.h
+++ b/tests/mailmap/mailmap_testdata.h
@@ -7,29 +7,6 @@ typedef struct mailmap_entry {
const char *replace_email;
} mailmap_entry;
-static const char string_mailmap[] =
- "# Simple Comment line\n"
- "<cto@company.xx> <cto@coompany.xx>\n"
- "Some Dude <some@dude.xx> nick1 <bugs@company.xx>\n"
- "Other Author <other@author.xx> nick2 <bugs@company.xx>\n"
- "Other Author <other@author.xx> <nick2@company.xx>\n"
- "Phil Hill <phil@company.xx> # Comment at end of line\n"
- "<joseph@company.xx> Joseph <bugs@company.xx>\n"
- "Santa Claus <santa.claus@northpole.xx> <me@company.xx>\n"
- "Untracked <untracked@company.xx>";
-
-static const mailmap_entry entries[] = {
- { NULL, "cto@company.xx", NULL, "cto@coompany.xx" },
- { "Some Dude", "some@dude.xx", "nick1", "bugs@company.xx" },
- { "Other Author", "other@author.xx", "nick2", "bugs@company.xx" },
- { "Other Author", "other@author.xx", NULL, "nick2@company.xx" },
- { "Phil Hill", NULL, NULL, "phil@company.xx" },
- { NULL, "joseph@company.xx", "Joseph", "bugs@company.xx" },
- { "Santa Claus", "santa.claus@northpole.xx", NULL, "me@company.xx" },
- /* This entry isn't in the bare repository */
- { "Untracked", NULL, NULL, "untracked@company.xx" }
-};
-
static const mailmap_entry resolved[] = {
{ "Brad", "cto@company.xx", "Brad", "cto@coompany.xx" },
{ "Brad L", "cto@company.xx", "Brad L", "cto@coompany.xx" },
diff --git a/tests/mailmap/parsing.c b/tests/mailmap/parsing.c
index dc5096c9c..e2ab05c99 100644
--- a/tests/mailmap/parsing.c
+++ b/tests/mailmap/parsing.c
@@ -8,6 +8,29 @@ static git_repository *g_repo;
static git_mailmap *g_mailmap;
static git_config *g_config;
+static const char string_mailmap[] =
+ "# Simple Comment line\n"
+ "<cto@company.xx> <cto@coompany.xx>\n"
+ "Some Dude <some@dude.xx> nick1 <bugs@company.xx>\n"
+ "Other Author <other@author.xx> nick2 <bugs@company.xx>\n"
+ "Other Author <other@author.xx> <nick2@company.xx>\n"
+ "Phil Hill <phil@company.xx> # Comment at end of line\n"
+ "<joseph@company.xx> Joseph <bugs@company.xx>\n"
+ "Santa Claus <santa.claus@northpole.xx> <me@company.xx>\n"
+ "Untracked <untracked@company.xx>";
+
+static const mailmap_entry entries[] = {
+ { NULL, "cto@company.xx", NULL, "cto@coompany.xx" },
+ { "Some Dude", "some@dude.xx", "nick1", "bugs@company.xx" },
+ { "Other Author", "other@author.xx", "nick2", "bugs@company.xx" },
+ { "Other Author", "other@author.xx", NULL, "nick2@company.xx" },
+ { "Phil Hill", NULL, NULL, "phil@company.xx" },
+ { NULL, "joseph@company.xx", "Joseph", "bugs@company.xx" },
+ { "Santa Claus", "santa.claus@northpole.xx", NULL, "me@company.xx" },
+ /* This entry isn't in the bare repository */
+ { "Untracked", NULL, NULL, "untracked@company.xx" }
+};
+
void test_mailmap_parsing__initialize(void)
{
g_repo = NULL;