blob: 07be3e73d14683728d6e38546b5571d67528cc0d [file] [log] [blame]
Yingdi Yu348f5ea2014-03-01 14:47:25 -08001/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil -*- */
2/**
3 * Copyright (C) 2013 Regents of the University of California.
4 * @author: Yingdi Yu <yingdi@cs.ucla.edu>
5 * See COPYING for copyright and distribution information.
6 */
7
8#include <boost/test/unit_test.hpp>
9
Yingdi Yu0b0a7362014-08-05 16:31:30 -070010#include "contact-storage.hpp"
11#include "cryptopp.hpp"
Yingdi Yu348f5ea2014-03-01 14:47:25 -080012#include <boost/filesystem.hpp>
13
Qiuhan Ding52f13832015-03-06 14:05:59 -080014namespace chronochat {
15namespace tests {
Yingdi Yu0b0a7362014-08-05 16:31:30 -070016
17using std::string;
Yingdi Yu348f5ea2014-03-01 14:47:25 -080018namespace fs = boost::filesystem;
19
20BOOST_AUTO_TEST_SUITE(TestContactStorage)
21
Yingdi Yu0b0a7362014-08-05 16:31:30 -070022const string dbName("chronos-20e9530008b27c661ad3429d1956fa1c509b652dce9273bfe81b7c91819c272c.db");
Yingdi Yu348f5ea2014-03-01 14:47:25 -080023
24BOOST_AUTO_TEST_CASE(InitializeTable)
25{
26 Name identity("/TestContactStorage/InitializeTable");
27
Yingdi Yu0b0a7362014-08-05 16:31:30 -070028 ContactStorage contactStorage(identity);
Yingdi Yu348f5ea2014-03-01 14:47:25 -080029 fs::path dbPath = fs::path(getenv("HOME")) / ".chronos" / dbName;
30
31 BOOST_CHECK(boost::filesystem::exists(dbPath));
32}
33
Yingdi Yu348f5ea2014-03-01 14:47:25 -080034BOOST_AUTO_TEST_SUITE_END()
Yingdi Yu0b0a7362014-08-05 16:31:30 -070035
Qiuhan Ding52f13832015-03-06 14:05:59 -080036} // namespace tests
37} // namespace chronochat