blob: 592152214e975c78b2c755626600fcb0ecc7ce92 [file] [log] [blame]
Alison Craig2a4d5282015-04-10 12:00:02 -06001/** NDN-Atmos: Cataloging Service for distributed data originally developed
2 * for atmospheric science data
3 * Copyright (C) 2015 Colorado State University
Chengyu Faneb0422c2015-03-04 16:34:14 -07004 *
Alison Craig2a4d5282015-04-10 12:00:02 -06005 * NDN-Atmos is free software: you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License as published by
7 * the Free Software Foundation, either version 3 of the License, or
8 * (at your option) any later version.
Chengyu Faneb0422c2015-03-04 16:34:14 -07009 *
Alison Craig2a4d5282015-04-10 12:00:02 -060010 * NDN-Atmos is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
Chengyu Faneb0422c2015-03-04 16:34:14 -070014 *
Alison Craig2a4d5282015-04-10 12:00:02 -060015 * You should have received a copy of the GNU General Public License
16 * along with this program. If not, see <http://www.gnu.org/licenses/>.
17**/
Chengyu Faneb0422c2015-03-04 16:34:14 -070018
19#include <boost/test/unit_test.hpp>
Alison Craig2a4d5282015-04-10 12:00:02 -060020
Chengyu Fan8b92f122015-03-09 22:13:36 -060021#include <json/value.h>
22#include <json/writer.h>
23#include <json/reader.h>
Alison Craig2a4d5282015-04-10 12:00:02 -060024
Chengyu Fan8b92f122015-03-09 22:13:36 -060025#include <iostream>
Chengyu Faneb0422c2015-03-04 16:34:14 -070026
Alison Craig2a4d5282015-04-10 12:00:02 -060027namespace atmos {
Chengyu Fanb25835b2015-04-28 17:09:35 -060028namespace tests {
Chengyu Faneb0422c2015-03-04 16:34:14 -070029
30BOOST_AUTO_TEST_SUITE(MasterSuite)
31
32BOOST_AUTO_TEST_CASE(SimpleTest)
33{
34 BOOST_CHECK(0==0);
35}
36
Chengyu Fan8b92f122015-03-09 22:13:36 -060037BOOST_AUTO_TEST_CASE(JsonTest)
38{
39 Json::Value original;
40 original["command"] = "test";
41
42 Json::FastWriter fastWriter;
43 std::string jsonMessage = fastWriter.write(original);
44
45 Json::Value parsedFromString;
46 Json::Reader reader;
47 bool result;
48 BOOST_CHECK_EQUAL(result = reader.parse(jsonMessage, parsedFromString), true);
49 if (result) {
50 BOOST_CHECK_EQUAL(original, parsedFromString);
51 }
52}
53
Chengyu Faneb0422c2015-03-04 16:34:14 -070054BOOST_AUTO_TEST_SUITE_END()
55
Chengyu Fanb25835b2015-04-28 17:09:35 -060056} //namespace tests
Alison Craig2a4d5282015-04-10 12:00:02 -060057} //namespace atmos