Make test functions statis if possible.

This commit is contained in:
levlam 2020-11-21 20:45:09 +03:00
parent 77de5110f5
commit ccb30077e7
3 changed files with 6 additions and 6 deletions

View File

@ -110,7 +110,7 @@ class Manager final : public Actor {
int query_size_; int query_size_;
}; };
void test_workers(int threads_n, int workers_n, int queries_n, int query_size) { static void test_workers(int threads_n, int workers_n, int queries_n, int query_size) {
SET_VERBOSITY_LEVEL(VERBOSITY_NAME(ERROR)); SET_VERBOSITY_LEVEL(VERBOSITY_NAME(ERROR));
ConcurrentScheduler sched; ConcurrentScheduler sched;

View File

@ -30,7 +30,7 @@ class NodeX : public td::MpscLinkQueueImpl::Node {
}; };
using QueueNode = td::MpscLinkQueueUniquePtrNode<NodeX>; using QueueNode = td::MpscLinkQueueUniquePtrNode<NodeX>;
QueueNode create_node(int value) { static QueueNode create_node(int value) {
return QueueNode(td::make_unique<NodeX>(value)); return QueueNode(td::make_unique<NodeX>(value));
} }

View File

@ -63,9 +63,9 @@ struct CheckExitGuard {
bool expected_value_; bool expected_value_;
}; };
CheckExitGuard check_exit_guard_true{true}; static CheckExitGuard check_exit_guard_true{true};
td::ExitGuard exit_guard; static td::ExitGuard exit_guard;
CheckExitGuard check_exit_guard_false{false}; static CheckExitGuard check_exit_guard_false{false};
#if TD_LINUX || TD_DARWIN #if TD_LINUX || TD_DARWIN
TEST(Misc, update_atime_saves_mtime) { TEST(Misc, update_atime_saves_mtime) {
@ -1065,7 +1065,7 @@ TEST(Misc, uint128) {
} }
template <template <class T> class HashT, class ValueT> template <template <class T> class HashT, class ValueT>
td::Status test_hash(const td::vector<ValueT> &values) { static td::Status test_hash(const td::vector<ValueT> &values) {
for (std::size_t i = 0; i < values.size(); i++) { for (std::size_t i = 0; i < values.size(); i++) {
for (std::size_t j = i; j < values.size(); j++) { for (std::size_t j = i; j < values.size(); j++) {
auto &a = values[i]; auto &a = values[i];