// ClusterContainer_t.cpp #include "ClusterContainer.h" #include #include #include using std::cout; using std::cerr; using std::endl; using std::string; using namespace trf; //********************************************************************** ClusterList CLUSTERS; class ClusterContainerTest : public ClusterContainer { public: const ClusterList& get_clusters() const { return CLUSTERS; } size_type size() const {return 0;} void add_cluster(const ClusterPtr& pclu) {} void drop_clusters() {} ClusterContainer* new_empty_container() const {return 0;} }; //********************************************************************** int main( ) { string component = "ClusterContainer"; string ok_prefix = component + " (I): "; string error_prefix = component + " test (E): "; cout << ok_prefix << "---------- Testing component " + component + ". ----------" << endl; // Make sure assert is enabled. bool assert_flag = false; assert ( ( assert_flag = true, assert_flag ) ); if ( ! assert_flag ) { cerr << "Assert is disabled" << endl; return 1; } //******************************************************************** ClusterContainerTest box; assert( box.get_clusters().size() == 0 ); //******************************************************************** cout << ok_prefix << "------------- All tests passed. -------------" << endl; return 0; //******************************************************************** }