/* -*- Mode: C++; c-file-style: "gnu"; indent-tabs-mode:nil -*- */
/*
 * Copyright (c) 2012 University of California, Los Angeles
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License version 2 as
 * published by the Free Software Foundation;
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program; if not, write to the Free Software
 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
 *
 * Author: Zhenkai Zhu <zhenkai@cs.ucla.edu>
 *         卞超轶 Chaoyi Bian <bcy@pku.edu.cn>
 *	   Alexander Afanasyev <alexander.afanasyev@ucla.edu>
 */

#include <boost/test/unit_test.hpp>
#include <boost/test/output_test_stream.hpp> 
using boost::test_tools::output_test_stream;
#include <vector>

#include <boost/make_shared.hpp>

#include "../model/sync-interest-table.h"

using namespace Sync;
using namespace std;
using namespace boost;

string sitToString(SyncInterestTable *sit) {
	vector<string> ent = sit->fetchAll();
	sort(ent.begin(), ent.end());
	string str = "";
	while(!ent.empty()){
		str += ent.back();
		ent.pop_back();
	}
	return str;
}

BOOST_AUTO_TEST_CASE (SyncInterestTableTest)
{
	SyncInterestTable sit;
	sit.insert("/ucla.edu/0");
	sit.insert("/ucla.edu/1");
	string str = sitToString(&sit);
	BOOST_CHECK_EQUAL(str, "/ucla.edu/1/ucla.edu/0");

	str = sitToString(&sit);
	BOOST_CHECK_EQUAL(str, "");

	sit.insert("/ucla.edu/0");
	sit.insert("/ucla.edu/1");
	sleep(2);
	sit.insert("/ucla.edu/0");
	sit.insert("/ucla.edu/2");
	sleep(3);
	str = sitToString(&sit);
	BOOST_CHECK_EQUAL(str, "/ucla.edu/2/ucla.edu/0");
}


