Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
auth: Organize code into two unit tests
auth-cache needs special setup
- Loading branch information
Showing
7 changed files
with
68 additions
and
63 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
/* Copyright (c) 2017 Dovecot authors, see the included COPYING file */ | ||
|
||
#ifndef TEST_AUTH_H | ||
#define TEST_AUTH_H 1 | ||
|
||
#include "lib.h" | ||
#include "test-common.h" | ||
|
||
void test_auth_request_var_expand(void); | ||
void test_db_dict_parse_cache_key(void); | ||
void test_username_filter(void); | ||
|
||
#endif | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
#include "lib.h" | ||
#include "test-common.h" | ||
#include "test-auth.h" | ||
|
||
int main(int argc, const char *argv[]) | ||
{ | ||
const char *match = ""; | ||
static const struct named_test test_functions[] = { | ||
TEST_NAMED(test_auth_request_var_expand) | ||
TEST_NAMED(test_db_dict_parse_cache_key) | ||
TEST_NAMED(test_username_filter) | ||
{ NULL, NULL } | ||
}; | ||
|
||
if (argc > 2 && strcasecmp(argv[1], "--match") == 0) | ||
match = argv[2]; | ||
|
||
return test_run_named(test_functions, match); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
#include "lib.h" | ||
#include "auth-common.h" | ||
|
||
struct auth_penalty *auth_penalty; | ||
time_t process_start_time; | ||
bool worker, worker_restart_request; | ||
void auth_module_load(const char *names ATTR_UNUSED) | ||
{ | ||
} | ||
void auth_refresh_proctitle(void) { | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters