Definition at line 91 of file testTableDataSourceCombinedViews.h. References Impala::Application::MediaTable::TableDataSourceCombinedViews::AddTableDataView(), Impala::Application::MediaTable::TableDataSourceCombinedViews::GetColumns(), Impala::Application::MediaTable::TableDataSourceCombinedViews::GetTotalRows(), IsValidTableDataSourceTest(), and IsValidTableDataViewTest(). 00091 { 00092 TableDataSourceTests::IsValidTableDataSourceTest(src); 00093 TableDataSourceTests::IsValidTableDataSourceTest(asrc); 00094 TableDataViewTests::IsValidTableDataViewTest(view); 00095 TableDataViewTests::IsValidTableDataViewTest(aview); 00096 00097 TableDataSourceCombinedViews* csrc = new TableDataSourceCombinedViews(); 00098 TableDataViewTests::IsValidTableDataViewTest(view); 00099 00100 BOOST_CHECK_EQUAL(csrc->GetTotalRows(), 0); 00101 BOOST_CHECK_EQUAL(csrc->GetColumns(true, true).size(), 0); 00102 00103 BOOST_CHECK(!csrc->AddTableDataView(view)); 00104 BOOST_CHECK_EQUAL(csrc->GetTotalRows(), 0); 00105 BOOST_CHECK_EQUAL(csrc->GetColumns(true, true).size(), 0); 00106 00107 BOOST_CHECK(csrc->AddTableDataView(view, "id")); 00108 BOOST_CHECK_EQUAL(csrc->GetTotalRows(), view->GetTotalRows()); 00109 BOOST_CHECK_EQUAL(csrc->GetColumns(true, true).size(), view->GetColumns(true,true).size()); 00110 BOOST_CHECK_GT(csrc->GetColumns(true, true).size(), 0); 00111 00112 BOOST_REQUIRE_EQUAL(csrc->GetTotalRows(), aview->GetTotalRows()); 00113 00114 BOOST_CHECK(csrc->AddTableDataView(aview)); 00115 BOOST_CHECK_EQUAL(csrc->GetTotalRows(), view->GetTotalRows()); 00116 BOOST_CHECK_EQUAL(csrc->GetTotalRows(), aview->GetTotalRows()); 00117 BOOST_CHECK_EQUAL(csrc->GetColumns(true, true).size(), view->GetColumns(true,true).size()+aview->GetColumns(true,true).size()-1); 00118 BOOST_CHECK_GT(csrc->GetColumns(true, true).size(), 0); 00119 00120 TableDataView* cview = new TableDataView(csrc); 00121 BOOST_REQUIRE(cview); 00122 TableDataViewTests::IsValidTableDataViewTest(cview); 00123 BOOST_CHECK_GT(cview->GetColumns(true, true).size(), 0); 00124 BOOST_WARN_GT(cview->GetColumns(true, false).size(), 0); 00125 00126 cview->SetSortColumn("id"); 00127 for(int i=0; i < cview->GetTotalRows(); i++) { 00128 BOOST_CHECK_EQUAL(cview->GetSortedIntData("id", i), i); 00129 BOOST_CHECK_EQUAL(cview->GetSortedNormalizedData("red", i), cview->GetSortedNormalizedData("purple", i)); 00130 BOOST_CHECK_EQUAL(cview->GetSortedNormalizedData("green", i), cview->GetSortedNormalizedData("orange", i)); 00131 BOOST_CHECK_EQUAL(cview->GetSortedNormalizedData("blue", i), cview->GetSortedNormalizedData("yellow", i)); 00132 } 00133 cview->SetSortColumn("red", false); 00134 for(int i=0; i < cview->GetTotalRows(); i++) { 00135 BOOST_CHECK_EQUAL(cview->GetSortedIntData("id", i), i); 00136 BOOST_CHECK_EQUAL(cview->GetSortedNormalizedData("red", i), cview->GetSortedNormalizedData("purple", i)); 00137 BOOST_CHECK_EQUAL(cview->GetSortedNormalizedData("green", i), cview->GetSortedNormalizedData("orange", i)); 00138 BOOST_CHECK_EQUAL(cview->GetSortedNormalizedData("blue", i), cview->GetSortedNormalizedData("yellow", i)); 00139 } 00140 cview->SetSortColumn("purple", false); 00141 for(int i=0; i < cview->GetTotalRows(); i++) { 00142 BOOST_CHECK_EQUAL(cview->GetSortedIntData("id", i), i); 00143 BOOST_CHECK_EQUAL(cview->GetSortedNormalizedData("red", i), cview->GetSortedNormalizedData("purple", i)); 00144 BOOST_CHECK_EQUAL(cview->GetSortedNormalizedData("green", i), cview->GetSortedNormalizedData("orange", i)); 00145 BOOST_CHECK_EQUAL(cview->GetSortedNormalizedData("blue", i), cview->GetSortedNormalizedData("yellow", i)); 00146 } 00147 cview->SetSortColumn("orange", false); 00148 double last = 0; 00149 for(int i=0; i < cview->GetTotalRows(); i++) { 00150 BOOST_CHECK_EQUAL(cview->GetSortedNormalizedData("red", i), cview->GetSortedNormalizedData("purple", i)); 00151 BOOST_CHECK_EQUAL(cview->GetSortedNormalizedData("green", i), cview->GetSortedNormalizedData("orange", i)); 00152 BOOST_CHECK_EQUAL(cview->GetSortedNormalizedData("blue", i), cview->GetSortedNormalizedData("yellow", i)); 00153 BOOST_CHECK_GE(cview->GetSortedNormalizedData("green", i), last); 00154 last = cview->GetSortedNormalizedData("green", i); 00155 } 00156 }
Here is the call graph for this function:
|