#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("ACTKUTST"); Timer::setTime("20140101.010101"); HostCreateCommand hcc("ns1.ACTKUTST.com.au"); const string xml(hcc.toXML()); ASSERT_EQ(xml, "ns1.ACTKUTST.com.auACTKUTST.20140101.010101.0"); } { CLTRID::setClID("ACTKUTST"); 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.ACTKUTST.com.au", &addrs); const string xml(hcc.toXML()); ASSERT_EQ(xml, "ns1.ACTKUTST.com.au192.168.0.1::1ACTKUTST.20140101.010101.0"); } } int main(int argc, char* argv[]) { TEST_run(doWork); return TEST_errorCount(); }