Add unit tests.

Signed-off-by: Ryu Ishimoto <ryu@midokura.com>