Пример #1
0
  TEST_EQUAL(file.getOptions().hasMSLevels(), true);
}
END_SECTION

START_SECTION((template <typename MapType> void load(const String &filename, MapType & map)))
{
  TOLERANCE_ABSOLUTE(0.01)

  MzDataFile file;
  PeakMap e;

  // real test
  file.load(OPENMS_GET_TEST_DATA_PATH("MzDataFile_1.mzData"), e);

  //test DocumentIdentifier addition
  TEST_STRING_EQUAL(e.getLoadedFilePath(), OPENMS_GET_TEST_DATA_PATH("MzDataFile_1.mzData"));
  TEST_STRING_EQUAL(FileTypes::typeToName(e.getLoadedFileType()), "mzData");

  //---------------------------------------------------------------------------
  // ms-level, RT, native ID
  //---------------------------------------------------------------------------
  TEST_EQUAL(e.size(), 3)
  TEST_EQUAL(e[0].getMSLevel(), 1)
  TEST_EQUAL(e[1].getMSLevel(), 2)
  TEST_EQUAL(e[2].getMSLevel(), 1)
  TEST_REAL_SIMILAR(e[0].getRT(), 60)
  TEST_REAL_SIMILAR(e[1].getRT(), 120)
  TEST_REAL_SIMILAR(e[2].getRT(), 180)
  TEST_STRING_EQUAL(e[0].getNativeID(), "spectrum=10")
  TEST_STRING_EQUAL(e[1].getNativeID(), "spectrum=11")
  TEST_STRING_EQUAL(e[2].getNativeID(), "spectrum=12")
Пример #2
0
END_SECTION

START_SECTION((template<typename MapType> void load(const String& filename, MapType& map) ))
  TOLERANCE_ABSOLUTE(0.01)

  PeakMap e;
  DTA2DFile file;

  //test exception
  TEST_EXCEPTION( Exception::FileNotFound , file.load("dummy/dummy.dta2d",e) )

  // real test
  file.load(OPENMS_GET_TEST_DATA_PATH("DTA2DFile_test_1.dta2d"),e);

  //test DocumentIdentifier addition
  TEST_STRING_EQUAL(e.getLoadedFilePath(), OPENMS_GET_TEST_DATA_PATH("DTA2DFile_test_1.dta2d"));
  TEST_STRING_EQUAL(FileTypes::typeToName(e.getLoadedFileType()),"dta2d");

  TEST_EQUAL(e.size(), 9);
  ABORT_IF(e.size() != 9)

  TEST_STRING_EQUAL(e[0].getNativeID(),"index=0")
  TEST_STRING_EQUAL(e[1].getNativeID(),"index=1")
  TEST_STRING_EQUAL(e[2].getNativeID(),"index=2")
  TEST_STRING_EQUAL(e[3].getNativeID(),"index=3")
  TEST_STRING_EQUAL(e[4].getNativeID(),"index=4")
  TEST_STRING_EQUAL(e[5].getNativeID(),"index=5")
  TEST_STRING_EQUAL(e[6].getNativeID(),"index=6")
  TEST_STRING_EQUAL(e[7].getNativeID(),"index=7")
  TEST_STRING_EQUAL(e[8].getNativeID(),"index=8")