00001 00041 #ifndef _LIST_TEST_H 00042 #define _LIST_TEST_H 00043 00044 #include "util.h" 00045 #include "test_util.h" 00046 #include <gtest.h> 00047 00048 using namespace container; 00049 using namespace std; 00050 00051 namespace container_test { 00052 00062 class List_test: public testing::Test { 00063 protected: 00064 00065 static const int SOME_OTHER_KEY; 00066 static const int ZERO_INDEX; 00067 static const int NEGATIVE_INDEX; 00068 static const int BIG_INDEX; 00069 static const int SOME_OTHER_INDEX; 00070 static const int INDEX_NOT_FOUND; 00071 static const int KEY_4; 00072 static const string KEY_4_AS_STRING; 00073 00074 /******************** Unit-test Helper Methods ********************/ 00075 00076 void verifyEmptyStateCoherence(List* a); 00077 00078 void verifyEmptyStateCoherence(List& a); 00079 00080 void verifyNonEmptyStateCoherence_tail(List* a, int count); 00081 00082 void verifyNonEmptyStateCoherence_tail(List& a, int count); 00083 00084 void verifyNonEmptyStateCoherence_notTail(List* a, int count); 00085 00086 void verifyNonEmptyStateCoherence_notTail(List& a, int count); 00087 00104 void generateDataAndPopulateList(Entity** &data, 00105 List* list, 00106 const int listSize, 00107 bool print = false); 00108 00109 00110 /******************** Unit-test methods for class List ********************/ 00111 00112 void defaultConstructor(const Object::Info* type); 00113 00114 void cursorControl(const Object::Info* type); 00115 00116 void purgeConents(const Object::Info* type); 00117 00118 void locateEntity(const Object::Info* type); 00119 00120 void entityAt(const Object::Info* type); 00121 00122 }; 00123 00124 } // namespace container_test 00125 #endif /* _LIST_TEST_H */