#include "common/init.hpp" #include "common/Test.hpp" #include "se/CLTRID.hpp" #include "se/HostCreateCommand.hpp" #include "session/Timer.hpp" #include using namespace std; void doWork() { init("./etc/toolkit2.conf"); { CLTRID::setClID("JTKUTEST"); Timer::setTime("20140101.010101"); HostCreateCommand hcc("ns1.jtkutest.com.au"); const string xml(hcc.toXML()); ASSERT_EQ(xml, "ns1.jtkutest.com.auJTKUTEST.20140101.010101.0"); } { CLTRID::setClID("JTKUTEST"); Timer::setTime("20140101.010101"); vector addrs; addrs.push_back(InetAddress("192.168.0.1", IPVersion::IPv4())); addrs.push_back(InetAddress("::1", IPVersion::IPv6())); HostCreateCommand hcc("ns1.jtkutest.com.au", &addrs); const string xml(hcc.toXML()); ASSERT_EQ(xml, "ns1.jtkutest.com.au192.168.0.1::1JTKUTEST.20140101.010101.0"); } } int main(int argc, char* argv[]) { TEST_run(doWork); return TEST_errorCount(); }