예제 #1
0
void DataSetTest_GenericData::ColsFromDataSetWithZeroRows()
{
	GenericData gd;
	GenericFileReader reader;
	reader.SetFilename("../data/small_cel_file_with_dataset_of_zero_rows");
	reader.ReadHeader(gd);

	// Open a DataSet that has 0 rows.
	DataSet* ds = gd.DataSet(0,3);
	CPPUNIT_ASSERT(ds);
	CPPUNIT_ASSERT(ds->Cols() == 2);
	CPPUNIT_ASSERT(ds->Rows() == 0);

	ds->Delete();

	// Open another DataSet that has 0 rows.
	ds = gd.DataSet(0,4);
	CPPUNIT_ASSERT(ds);
	CPPUNIT_ASSERT(ds->Cols() == 2);
	CPPUNIT_ASSERT(ds->Rows() == 0);

	ds->Delete();
}