mirror of
https://gitlab.torproject.org/tpo/core/tor.git
synced 2025-02-26 07:31:33 +01:00
Prepare some mock functions to test #9288.
This commit is contained in:
parent
6e40806025
commit
2e7c531fdc
2 changed files with 17 additions and 14 deletions
|
@ -3969,9 +3969,9 @@ tor_spawn_background(const char *const filename, const char **argv,
|
||||||
* <b>process_handle</b>.
|
* <b>process_handle</b>.
|
||||||
* If <b>also_terminate_process</b> is true, also terminate the
|
* If <b>also_terminate_process</b> is true, also terminate the
|
||||||
* process of the process handle. */
|
* process of the process handle. */
|
||||||
void
|
MOCK_IMPL(void,
|
||||||
tor_process_handle_destroy(process_handle_t *process_handle,
|
tor_process_handle_destroy,(process_handle_t *process_handle,
|
||||||
int also_terminate_process)
|
int also_terminate_process))
|
||||||
{
|
{
|
||||||
if (!process_handle)
|
if (!process_handle)
|
||||||
return;
|
return;
|
||||||
|
@ -4570,8 +4570,8 @@ log_from_handle(HANDLE *pipe, int severity)
|
||||||
/** Return a smartlist containing lines outputted from
|
/** Return a smartlist containing lines outputted from
|
||||||
* <b>handle</b>. Return NULL on error, and set
|
* <b>handle</b>. Return NULL on error, and set
|
||||||
* <b>stream_status_out</b> appropriately. */
|
* <b>stream_status_out</b> appropriately. */
|
||||||
smartlist_t *
|
MOCK_IMPL(smartlist_t *,
|
||||||
tor_get_lines_from_handle(FILE *handle, enum stream_status *stream_status_out)
|
tor_get_lines_from_handle,(FILE *handle, enum stream_status *stream_status_out))
|
||||||
{
|
{
|
||||||
enum stream_status stream_status;
|
enum stream_status stream_status;
|
||||||
char stdout_buf[400];
|
char stdout_buf[400];
|
||||||
|
|
|
@ -491,18 +491,21 @@ FILE *tor_process_get_stdout_pipe(process_handle_t *process_handle);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef _WIN32
|
#ifdef _WIN32
|
||||||
struct smartlist_t *
|
MOCK_DECL(struct smartlist_t *,
|
||||||
tor_get_lines_from_handle(HANDLE *handle,
|
tor_get_lines_from_handle,(HANDLE *handle,
|
||||||
enum stream_status *stream_status);
|
enum stream_status *stream_status));
|
||||||
#else
|
#else
|
||||||
struct smartlist_t *
|
MOCK_DECL(struct smartlist_t *,
|
||||||
tor_get_lines_from_handle(FILE *handle,
|
tor_get_lines_from_handle,(FILE *handle,
|
||||||
enum stream_status *stream_status);
|
enum stream_status *stream_status));
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
int tor_terminate_process(process_handle_t *process_handle);
|
int
|
||||||
void tor_process_handle_destroy(process_handle_t *process_handle,
|
tor_terminate_process(process_handle_t *process_handle);
|
||||||
int also_terminate_process);
|
|
||||||
|
MOCK_DECL(void,
|
||||||
|
tor_process_handle_destroy,(process_handle_t *process_handle,
|
||||||
|
int also_terminate_process));
|
||||||
|
|
||||||
/* ===== Insecure rng */
|
/* ===== Insecure rng */
|
||||||
typedef struct tor_weak_rng_t {
|
typedef struct tor_weak_rng_t {
|
||||||
|
|
Loading…
Add table
Reference in a new issue