Yingdi Yu | 348f5ea | 2014-03-01 14:47:25 -0800 | [diff] [blame] | 1 | /* -*- 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 Yu | 0b0a736 | 2014-08-05 16:31:30 -0700 | [diff] [blame^] | 10 | #include "contact-storage.hpp" |
| 11 | #include "cryptopp.hpp" |
Yingdi Yu | 348f5ea | 2014-03-01 14:47:25 -0800 | [diff] [blame] | 12 | #include <boost/filesystem.hpp> |
| 13 | |
Yingdi Yu | 0b0a736 | 2014-08-05 16:31:30 -0700 | [diff] [blame^] | 14 | namespace chronos { |
| 15 | |
| 16 | using std::string; |
Yingdi Yu | 348f5ea | 2014-03-01 14:47:25 -0800 | [diff] [blame] | 17 | namespace fs = boost::filesystem; |
| 18 | |
| 19 | BOOST_AUTO_TEST_SUITE(TestContactStorage) |
| 20 | |
Yingdi Yu | 0b0a736 | 2014-08-05 16:31:30 -0700 | [diff] [blame^] | 21 | const string dbName("chronos-20e9530008b27c661ad3429d1956fa1c509b652dce9273bfe81b7c91819c272c.db"); |
Yingdi Yu | 348f5ea | 2014-03-01 14:47:25 -0800 | [diff] [blame] | 22 | |
| 23 | BOOST_AUTO_TEST_CASE(InitializeTable) |
| 24 | { |
| 25 | Name identity("/TestContactStorage/InitializeTable"); |
| 26 | |
Yingdi Yu | 0b0a736 | 2014-08-05 16:31:30 -0700 | [diff] [blame^] | 27 | ContactStorage contactStorage(identity); |
Yingdi Yu | 348f5ea | 2014-03-01 14:47:25 -0800 | [diff] [blame] | 28 | fs::path dbPath = fs::path(getenv("HOME")) / ".chronos" / dbName; |
| 29 | |
| 30 | BOOST_CHECK(boost::filesystem::exists(dbPath)); |
| 31 | } |
| 32 | |
Yingdi Yu | 348f5ea | 2014-03-01 14:47:25 -0800 | [diff] [blame] | 33 | BOOST_AUTO_TEST_SUITE_END() |
Yingdi Yu | 0b0a736 | 2014-08-05 16:31:30 -0700 | [diff] [blame^] | 34 | |
| 35 | } // namespace chronos |