mirror of
https://gitlab.torproject.org/tpo/core/tor.git
synced 2024-11-11 21:53:48 +01:00
3ce3984772
A new set of unit test cases are provided, as well as introducing an alternative paradigm and macros to support it. Primarily, each test case is given its own namespace, in order to isolate tests from each other. We do this by in the usual fashion, by appending module and submodule names to our symbols. New macros assist by reducing friction for this and other tasks, like overriding a function in the global namespace with one in the current namespace, or declaring integer variables to assist tracking how many times a mock has been called. A set of tests for a small-scale module has been included in this commit, in order to highlight how the paradigm can be used. This suite gives 100% coverage to status.c in test execution.
19 lines
355 B
C
19 lines
355 B
C
/* Copyright (c) 2010-2013, The Tor Project, Inc. */
|
|
/* See LICENSE for licensing information */
|
|
|
|
#ifndef TOR_STATUS_H
|
|
#define TOR_STATUS_H
|
|
|
|
#include "testsupport.h"
|
|
|
|
int log_heartbeat(time_t now);
|
|
|
|
#ifdef STATUS_PRIVATE
|
|
STATIC int count_circuits(void);
|
|
STATIC char *secs_to_uptime(long secs);
|
|
STATIC char *bytes_to_usage(uint64_t bytes);
|
|
#endif
|
|
|
|
#endif
|
|
|