Definition at line 34 of file testWritableTableDataSource.h. References IsValidTableDataSourceTest(), Impala::Application::MediaTable::TableDataSource::TYPE_IMAGE, Impala::Application::MediaTable::TableDataSource::TYPE_INT, Impala::Application::MediaTable::TableDataSource::TYPE_NORMALIZEDVALUE, and Impala::Application::MediaTable::TableDataSource::TYPE_TEXT. 00034 { 00035 00036 BOOST_REQUIRE(src); 00037 00038 BOOST_CHECK_EQUAL(src->GetTotalRows(), 0); 00039 00040 BOOST_CHECK_EQUAL(src->GetColumns(true, true).size(), 0); 00041 00042 src->AddColumn("id", TableDataSource::TYPE_INT); 00043 src->AddColumn("image", TableDataSource::TYPE_IMAGE); 00044 src->AddColumn("name", TableDataSource::TYPE_TEXT); 00045 src->AddColumn("rank", TableDataSource::TYPE_NORMALIZEDVALUE); 00046 00047 BOOST_CHECK_EQUAL(src->GetColumns(true, true).size(), 4); 00048 00049 BOOST_CHECK_EQUAL(src->GetTotalRows(), 0); 00050 00051 for(uint i=0; i < 100; i++) { 00052 src->AddIntData("id", i); 00053 src->AddImageData("image", 0); 00054 src->AddTextData("name", "Test row "+ i); 00055 src->AddDoubleData("rank", ((double) i) /100); 00056 } 00057 BOOST_CHECK_EQUAL(src->GetTotalRows(), 100); 00058 for(int i=0; i < 100; i++) { 00059 BOOST_CHECK_EQUAL(src->GetIntDataByID("id", i), i); 00060 BOOST_CHECK(0 == src->GetImageDataByID("image", i)); 00061 BOOST_CHECK_EQUAL(src->GetTextDataByID("name", i), "Test row "+ i); 00062 BOOST_CHECK_EQUAL(src->GetDoubleDataByID("rank", i), ((double) i)/100); 00063 } 00064 BOOST_CHECK_EQUAL(src->GetDoubleDataByID("rank", 50), 0.5); 00065 00066 TableDataSourceTests::IsValidTableDataSourceTest(src); 00067 00068 // ToDo: Test Delete 00069 }
Here is the call graph for this function:
|