test: Expose ProcessWork() function

pull/34/head
David Drysdale 9 years ago
parent c778f0136b
commit f9b9817d1d
  1. 4
      test/ares-test.cc
  2. 6
      test/ares-test.h

@ -13,8 +13,6 @@
namespace ares {
namespace test {
namespace {
void ProcessWork(ares_channel channel,
int extrafd, std::function<void(int)> process_extra) {
int nfds, count;
@ -53,8 +51,6 @@ void ProcessWork(ares_channel channel,
}
}
} // namespace
bool verbose = false;
int mock_port = 5300;

@ -12,6 +12,7 @@
#include "gtest/gtest.h"
#include "gmock/gmock.h"
#include <functional>
#include <map>
namespace ares {
@ -23,6 +24,11 @@ namespace test {
extern bool verbose;
extern int mock_port;
// Process all pending work on ares-owned file descriptors, plus
// optionally the given FD + work function.
void ProcessWork(ares_channel channel,
int extrafd, std::function<void(int)> process_extra);
// Test fixture that ensures library initialization, and allows
// memory allocations to be failed.
class LibraryTest : public ::testing::Test {

Loading…
Cancel
Save