bool NHttpTestManager::test_input = false;
bool NHttpTestManager::test_output = false;
-NHttpTestInput NHttpTestManager::test_input_source("nhttp_test_msgs.txt");
+NHttpTestInput* NHttpTestManager::test_input_source = nullptr;
const char* NHttpTestManager::test_output_prefix = "nhttpresults/testcase";
int64_t NHttpTestManager::test_number = -1;
FILE* NHttpTestManager::test_out = nullptr;
}
}
+void NHttpTestManager::activate_test_input() {
+ test_input = true;
+ if (test_input_source == nullptr) {
+ test_input_source = new NHttpTestInput("nhttp_test_msgs.txt");
+ }
+}
+
class NHttpTestManager {
public:
static bool use_test_input() { return test_input; };
- static void activate_test_input() { test_input = true; };
+ static void activate_test_input();
static void activate_test_output() { test_output = true; };
- static NHttpTestInput *get_test_input_source() { return &test_input_source; };
+ static NHttpTestInput* get_test_input_source() { return test_input_source; };
static void update_test_number(int64_t new_test_number);
static bool use_test_output() { return test_output || test_input; };
static FILE* get_output_file() { return (test_out != nullptr) ? test_out : stdout; };
// Test input read from file
static bool test_input;
- static NHttpTestInput test_input_source;
+ static NHttpTestInput* test_input_source;
// Printing results of message processing
static bool test_output;