sp
[ghsmtp.git] / TLD-test.cpp
blobb6d85923a907eced5968a07bd4d0ce001fe9952f
1 #include "TLD.hpp"
3 #include <iostream>
5 int main(int argc, char const* argv[])
7 TLD tld;
9 CHECK_NOTNULL(tld.get_registered_domain("digilicious.com"));
10 CHECK_NOTNULL(tld.get_registered_domain("yahoo.com"));
11 CHECK_NOTNULL(tld.get_registered_domain("google.com"));
13 CHECK_NOTNULL(tld.get_registered_domain("foo.blogspot.com.ar"));
15 CHECK_EQ(strcmp(tld.get_registered_domain("pi.digilicious.com"),
16 "digilicious.com"),
17 0);
19 CHECK_EQ(strcmp(tld.get_registered_domain("outmail14.phi.meetup.com"),
20 "meetup.com"),
21 0);
23 CHECK(nullptr == tld.get_registered_domain("not_a_domain_at_all"));
24 CHECK(nullptr == tld.get_registered_domain(".com"));
25 CHECK(nullptr == tld.get_registered_domain("."));
27 CHECK_EQ(strcmp(tld.get_registered_domain("reward.yournewestbonuspoints.com"),
28 "yournewestbonuspoints.com"),
29 0);