Yingdi Yu | 348f5ea | 2014-03-01 14:47:25 -0800 | [diff] [blame] | 1 | /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil -*- */ |
| 2 | /** |
Varun Patil | a24bd3e | 2020-11-24 10:08:33 +0530 | [diff] [blame] | 3 | * Copyright (C) 2020 Regents of the University of California. |
Yingdi Yu | 348f5ea | 2014-03-01 14:47:25 -0800 | [diff] [blame] | 4 | * @author: Yingdi Yu <yingdi@cs.ucla.edu> |
| 5 | * See COPYING for copyright and distribution information. |
| 6 | */ |
| 7 | |
Yingdi Yu | 0b0a736 | 2014-08-05 16:31:30 -0700 | [diff] [blame] | 8 | #include "contact-storage.hpp" |
Varun Patil | a24bd3e | 2020-11-24 10:08:33 +0530 | [diff] [blame] | 9 | |
| 10 | #include <boost/test/unit_test.hpp> |
Yingdi Yu | 348f5ea | 2014-03-01 14:47:25 -0800 | [diff] [blame] | 11 | #include <boost/filesystem.hpp> |
| 12 | |
Qiuhan Ding | 52f1383 | 2015-03-06 14:05:59 -0800 | [diff] [blame] | 13 | namespace chronochat { |
| 14 | namespace tests { |
Yingdi Yu | 0b0a736 | 2014-08-05 16:31:30 -0700 | [diff] [blame] | 15 | |
Yingdi Yu | 348f5ea | 2014-03-01 14:47:25 -0800 | [diff] [blame] | 16 | namespace fs = boost::filesystem; |
| 17 | |
| 18 | BOOST_AUTO_TEST_SUITE(TestContactStorage) |
| 19 | |
Davide Pesavento | 7676b56 | 2020-12-14 00:41:26 -0500 | [diff] [blame^] | 20 | const std::string dbName("chronos-20e9530008b27c661ad3429d1956fa1c509b652dce9273bfe81b7c91819c272c.db"); |
Yingdi Yu | 348f5ea | 2014-03-01 14:47:25 -0800 | [diff] [blame] | 21 | |
| 22 | BOOST_AUTO_TEST_CASE(InitializeTable) |
| 23 | { |
| 24 | Name identity("/TestContactStorage/InitializeTable"); |
| 25 | |
Yingdi Yu | 0b0a736 | 2014-08-05 16:31:30 -0700 | [diff] [blame] | 26 | ContactStorage contactStorage(identity); |
Yingdi Yu | 348f5ea | 2014-03-01 14:47:25 -0800 | [diff] [blame] | 27 | fs::path dbPath = fs::path(getenv("HOME")) / ".chronos" / dbName; |
| 28 | |
| 29 | BOOST_CHECK(boost::filesystem::exists(dbPath)); |
| 30 | } |
| 31 | |
Yingdi Yu | 348f5ea | 2014-03-01 14:47:25 -0800 | [diff] [blame] | 32 | BOOST_AUTO_TEST_SUITE_END() |
Yingdi Yu | 0b0a736 | 2014-08-05 16:31:30 -0700 | [diff] [blame] | 33 | |
Qiuhan Ding | 52f1383 | 2015-03-06 14:05:59 -0800 | [diff] [blame] | 34 | } // namespace tests |
| 35 | } // namespace chronochat |