libtld: /home/snapwebsites/snapcpp/contrib/libtld/tests/tld_test_object.cpp File Reference

libtld  1.5.13
A library to determine the Top-Level Domain name of any URL.
tld_test_object.cpp File Reference

Test the tld() function through the C++ object. More...

#include "libtld/tld.h"
#include <string.h>
#include <stdlib.h>
#include <stdio.h>
Include dependency graph for tld_test_object.cpp:

Go to the source code of this file.




void error (const std::string &msg)
int main (int argc, char *argv[])
void test_invalid ()
void test_valid_uri (const char *uri, const char *tld, const char *domain, const char *sub_domains, tld_category category, const char *country)


int err_count = 0
int verbose = 0

Detailed Description

This file implements various test to verify that the tld() function functions as expected in C++.

Definition in file tld_test_object.cpp.

Macro Definition Documentation

#define EXPECTED_THROW (   f)
try \
{ \
static_cast<void>(bad.f()); \
error("error: bad." #f "() of \"\" did not throw an error."); \
} \
catch(const invalid_domain&) \
{ \
void error(const std::string &msg)
Print an error.
Exception thrown when querying for data of an invalid domain.
Definition: tld.h:154

Definition at line 48 of file tld_test_object.cpp.

This document is part of the Snap! Websites Project.

Copyright by Made to Order Software Corp.

Syndicate content

Snap! Websites
An Open Source CMS System in C++

Contact Us Directly