OpenSDN source code
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
test_xml_dummy.cc
Go to the documentation of this file.
1 #include "base/os.h"
2 #include <iostream>
3 #include <boost/program_options.hpp>
4 #include <testing/gunit.h>
5 #include <test/test_cmn_util.h>
6 #include "test_xml.h"
7 #include "test_xml_oper.h"
8 
9 using namespace std;
10 namespace opt = boost::program_options;
11 
12 void RouterIdDepInit(Agent *agent) {
13 }
14 
15 static void GetArgs(char *test_file, int argc, char *argv[]) {
16  test_file[0] = '\0';
17  opt::options_description desc("Options");
18  opt::variables_map vars;
19  desc.add_options()
20  ("help", "Print help message")
21  ("test-data", opt::value<string>(), "Specify test data file");
22 
23  opt::store(opt::parse_command_line(argc, argv, desc), vars);
24  opt::notify(vars);
25  if (vars.count("test-data")) {
26  strcpy(test_file, vars["test-data"].as<string>().c_str());
27  }
28  return;
29 }
30 
31 class TestDummy : public ::testing::Test {
32 };
33 
34 TEST_F(TestDummy, test_1) {
35  AgentUtXmlTest test("controller/src/vnsw/agent/test-xml/dummy.xml");
36  AgentUtXmlOperInit(&test);
37  if (test.Load() == true) {
38  test.ReadXml();
39 
40  string str;
41  test.ToString(&str);
42  cout << str << endl;
43  test.Run();
44  }
45 }
46 
47 int main(int argc, char *argv[]) {
48  GETUSERARGS();
49  client = TestInit(init_file, ksync_init);
50  int ret = RUN_ALL_TESTS();
51  TestShutdown();
52  delete client;
53  return ret;
54 }
void ToString(std::string *str)
Definition: test_xml.cc:242
bool ReadXml()
Definition: test_xml.cc:178
void AgentUtXmlOperInit(AgentUtXmlTest *test)
Definition: agent.h:358
static void GetArgs(char *test_file, int argc, char *argv[])
TEST_F(TestDummy, test_1)
void RouterIdDepInit(Agent *agent)