您当前的位置:首页 > IT编程 > C++
| C语言 | Java | VB | VC | python | Android | TensorFlow | C++ | oracle | 学术与代码 | cnn卷积神经网络 | gnn | 图像修复 | Keras | 数据集 | Neo4j | 自然语言处理 | 深度学习 | 医学CAD | 医学影像 | 超参数 | pointnet | pytorch | 异常检测 | Transformers | 情感分类 | 知识图谱 |

自学教程:C++ CPPUNIT_ASSERT_NO_THROW函数代码示例

51自学网 2021-06-01 20:05:01
  C++
这篇教程C++ CPPUNIT_ASSERT_NO_THROW函数代码示例写得很实用,希望能帮到您。

本文整理汇总了C++中CPPUNIT_ASSERT_NO_THROW函数的典型用法代码示例。如果您正苦于以下问题:C++ CPPUNIT_ASSERT_NO_THROW函数的具体用法?C++ CPPUNIT_ASSERT_NO_THROW怎么用?C++ CPPUNIT_ASSERT_NO_THROW使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。

在下文中一共展示了CPPUNIT_ASSERT_NO_THROW函数的24个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。

示例1: matrix

 void MatrixWrapperTest::testAt() {     MatrixImpl matrix(3, 2, Matrix::INT_32);          CPPUNIT_ASSERT_NO_THROW(matrix.at<int32_t>(0, 1) = 42);     CPPUNIT_ASSERT_EQUAL((int32_t)(42), const_cast<const MatrixImpl &>(matrix).at<int32_t>(0,1)); }
开发者ID:joccccc,项目名称:stromx,代码行数:7,


示例2: CPPUNIT_ASSERT_NO_THROW

void newtestclass::testAplusb_out_of_range_NO_THROW_03() {    int a = 100;    int b = 1;    APlusB aPlusB;    CPPUNIT_ASSERT_NO_THROW(aPlusB.aplusb(a, b));}
开发者ID:8Observer8,项目名称:exampleOfException_APlusB,代码行数:7,


示例3: CPPUNIT_ASSERT_NO_THROW

    void    StamperTest::stamp()    {	// test if stamping works	StamperTestCommand stamp;	stamp.magic.postPaid = false;	stamper->setStamp(stamp);	wns::ldk::CompoundPtr compound;	CPPUNIT_ASSERT_NO_THROW(compound = sendCompound(newFakeCompound()));	CPPUNIT_ASSERT_EQUAL((unsigned int)1, compoundsSent());	StamperTestCommand* command = stamper->getCommand(compound->getCommandPool());	CPPUNIT_ASSERT(!command->magic.postPaid);	// test if Stamper uses its own instance to stamp	stamp.magic.postPaid = true;	compound = sendCompound(newFakeCompound());	CPPUNIT_ASSERT_EQUAL((unsigned int)2, compoundsSent());	command = stamper->getCommand(compound->getCommandPool());	CPPUNIT_ASSERT(!command->magic.postPaid);	// test if updating the stamp works	stamper->setStamp(stamp);	compound = sendCompound(newFakeCompound());	CPPUNIT_ASSERT_EQUAL((unsigned int)3, compoundsSent());	command = stamper->getCommand(compound->getCommandPool());	CPPUNIT_ASSERT(command->magic.postPaid);    }
开发者ID:lshmenor,项目名称:IMTAphy,代码行数:27,


示例4: BCESfindNearTest

void xRinexEphemerisStore :: BCESfindNearTest (void){	ofstream DumpData;	DumpData.open ("Logs/findNearTest.txt");	gpstk::Rinex3EphemerisStore Store;        int nr;	nr = Store.loadFile("TestRinex06.031");        std::list<gpstk::Rinex3NavData> R3NList;        gpstk::GPSEphemerisStore GStore;        list<gpstk::Rinex3NavData>::const_iterator it;        Store.addToList(R3NList);        for (it = R3NList.begin(); it != R3NList.end(); ++it)          GStore.addEphemeris(gpstk::EngEphemeris(*it));	gpstk::CivilTime Time(2006,1,31,13,0,1,2);        const gpstk::CommonTime ComTime = (gpstk::CommonTime)Time;	short PRN0 = 0;	short PRN1 = 1;	short PRN15 = 15;	short PRN32 = 32;	short PRN33 = 33;   gpstk::SatID sid0(PRN0,gpstk::SatID::systemGPS);   gpstk::SatID sid1(PRN1,gpstk::SatID::systemGPS);   gpstk::SatID sid15(PRN15,gpstk::SatID::systemGPS);   gpstk::SatID sid32(PRN32,gpstk::SatID::systemGPS);   gpstk::SatID sid33(PRN33,gpstk::SatID::systemGPS);	try	{		CPPUNIT_ASSERT_THROW(GStore.findNearEphemeris(sid0,ComTime),gpstk::InvalidRequest);		CPPUNIT_ASSERT_THROW(GStore.findNearEphemeris(sid33,ComTime),gpstk::InvalidRequest);		CPPUNIT_ASSERT_THROW(GStore.findNearEphemeris(sid1,gpstk::CommonTime::END_OF_TIME),					gpstk::InvalidRequest);		CPPUNIT_ASSERT_NO_THROW(GStore.findNearEphemeris(sid1, ComTime));		const gpstk::EngEphemeris Eph1 = GStore.findNearEphemeris(sid1, ComTime);		const gpstk::EngEphemeris Eph15 = GStore.findNearEphemeris(sid15, ComTime);		const gpstk::EngEphemeris Eph32 = GStore.findNearEphemeris(sid32, ComTime);		GStore.clear();		GStore.addEphemeris(Eph1);		GStore.addEphemeris(Eph15);		GStore.addEphemeris(Eph32);		GStore.dump(DumpData,1);	}	catch (gpstk::Exception& e)	{                e.addLocation(FILE_LOCATION);		cout << e;	}	CPPUNIT_ASSERT(fileEqualTest((char*)"Logs/findNearTest.txt",(char*)"Checks/findNearTest.chk"));}
开发者ID:idaohang,项目名称:GPSTk,代码行数:59,


示例5: app

/** * @details * Try to create a PipelineApplication with a configuration file name. * Expect no exceptions. */void PipelineApplicationTest::test_commandLine_config(){    int argc = 2;    char *argv[] = {(char*)"pelican", (char*)"--config=settings.xml"};    QCoreApplication app(argc, argv);    CPPUNIT_ASSERT_NO_THROW(PipelineApplication(argc, argv));}
开发者ID:Error323,项目名称:pelican,代码行数:13,


示例6: callConstantMethodInBaseClass_usesConstantInstance_noException

 void callConstantMethodInBaseClass_usesConstantInstance_noException() {     DerivesToUseConstMethod instance;     DerivesToUseConstMethod const* const_instance = &instance;     OOLUA::register_class<DerivesToUseConstMethod>(*m_lua);     m_lua->run_chunk("return function(obj) obj:cpp_func_const() end");     CPPUNIT_ASSERT_NO_THROW(m_lua->call(1, const_instance)); }
开发者ID:RyanSwann1,项目名称:ClimLib,代码行数:8,


示例7: CPPUNIT_ASSERT_NO_THROW

void TriangleTestFixture::predicateTesting(){	// Shouldn't throw an error, unless <= predicate was flipped	CPPUNIT_ASSERT_NO_THROW(predicate1 = std::make_unique<Triangle>(3, 4, 5));	// Should throw an error, unless an || was flipped	CPPUNIT_ASSERT_THROW(predicate2 = std::make_unique<Triangle>(1, 1, 3), NotTriangleException);}
开发者ID:Amazao2,项目名称:CPPUnitDemo,代码行数:8,


示例8: CPPUNIT_ASSERT_NO_THROW

void TestAssertTest::testAssertNoThrow(){   int x;   CPPUNIT_ASSERT_NO_THROW( x = 1234 );   (void)x;   try   {      CPPUNIT_ASSERT_NO_THROW( throw std::exception() );   }   catch ( CPPUNIT_NS::Exception & )   {      return;   }   throw std::exception();}
开发者ID:LesleyLai,项目名称:cppunit,代码行数:17,


示例9: type

void ImageReaderWriterTest::testImageWriterExtension(){    // Data to write    const size_t dim = 3;    ::fwTools::Type type("uint8");    ::fwData::Image::SizeType sizeExpected(dim);    sizeExpected[0] = 10;    sizeExpected[1] = 20;    sizeExpected[2] = 30;    ::fwData::Image::SpacingType spacingExpected(dim);    spacingExpected[0] = 0.24;    spacingExpected[1] = 1.07;    spacingExpected[2] = 2.21;    ::fwData::Image::OriginType originExpected(dim);    originExpected[0] = -05.6;    originExpected[1] = 15.16;    originExpected[2] = 11.11;    ::fwData::Image::sptr image = ::fwData::Image::New();    ::fwTest::generator::Image::generateImage(image, sizeExpected, spacingExpected, originExpected, type);    // Write to vtk image.    const ::boost::filesystem::path file = ::fwTools::System::getTemporaryFolder()/ "temporaryFile.xxx";    {        const std::string srvtype("::io::IWriter");        const std::string srvname("::ioVTK::ImageWriterService");        ::fwServices::IService::sptr srv;        srv = ::fwServices::registry::ServiceFactory::getDefault()->create( srvtype, srvname );        CPPUNIT_ASSERT_MESSAGE(std::string("Failed to create service ") + srvname, srv);        ::fwServices::OSR::registerService( image , srv );        CPPUNIT_ASSERT_NO_THROW( srv->setConfiguration(getIOConfiguration(file)) );        CPPUNIT_ASSERT_NO_THROW( srv->configure() );        CPPUNIT_ASSERT_NO_THROW( srv->start() );        CPPUNIT_ASSERT_THROW( srv->update(), ::fwTools::Failed);        CPPUNIT_ASSERT_NO_THROW( srv->stop() );        ::fwServices::OSR::unregisterService( srv );    }}
开发者ID:corentindesfarges,项目名称:fw4spl,代码行数:45,


示例10: GetImageStatisticsNoRules

  void GetImageStatisticsNoRules() {    auto statisticsNode = mitk::CreateImageStatisticsNode(m_statisticsContainer, "testStatistics");    auto standaloneDataStorage = mitk::StandaloneDataStorage::New();    standaloneDataStorage->Add(statisticsNode);    //no rules + 1 image --> test return nullptr    mitk::ImageStatisticsContainer::ConstPointer emptyStatistic;    CPPUNIT_ASSERT_NO_THROW(emptyStatistic = mitk::ImageStatisticsContainerManager::GetImageStatistics(standaloneDataStorage.GetPointer(), m_image.GetPointer()));    CPPUNIT_ASSERT_EQUAL(emptyStatistic.IsNull(), true);    //no rules + 1 image + 1 mask --> test return nullptr    CPPUNIT_ASSERT_NO_THROW(emptyStatistic = mitk::ImageStatisticsContainerManager::GetImageStatistics(standaloneDataStorage.GetPointer(), m_image.GetPointer(), m_mask.GetPointer()));    CPPUNIT_ASSERT_EQUAL(emptyStatistic.IsNull(), true);    //no rules + 1 image + 1 planarFigure --> test return nullptr    CPPUNIT_ASSERT_NO_THROW(emptyStatistic = mitk::ImageStatisticsContainerManager::GetImageStatistics(standaloneDataStorage.GetPointer(), m_image.GetPointer(), m_planarFigure.GetPointer()));    CPPUNIT_ASSERT_EQUAL(emptyStatistic.IsNull(), true);  }
开发者ID:Cdebus,项目名称:MITK,代码行数:18,


示例11: TestAssign

    void TestAssign(void)    {        SCXCoreLib::SCXFilePath fp = *m_path;        // Check may assign to itself.        CPPUNIT_ASSERT_NO_THROW(*m_path = *m_path);        // Check content after assign operation is equal.        CPPUNIT_ASSERT(fp.Get() == m_path->Get());    }
开发者ID:Microsoft,项目名称:pal,代码行数:9,


示例12: TestNoConsumers

 void TestNoConsumers() {     SCXCoreLib::SCXLogMediatorSimple mediator;     CPPUNIT_ASSERT_NO_THROW(mediator.LogThisItem(SCXCoreLib::SCXLogItem(L"scxcore.something",                                                                         SCXCoreLib::eHysterical,                                                                         L"cowabunga",                                                                         SCXSRCLOCATION,                                                                         0))); }
开发者ID:Microsoft,项目名称:pal,代码行数:9,


示例13: ImageImpl

 void ImageWrapperTest::testResizeLength() {     m_image = new ImageImpl();     CPPUNIT_ASSERT_NO_THROW(m_image->resize(300, 200, runtime::Image::BGR_24));     CPPUNIT_ASSERT_EQUAL((unsigned int)(300), m_image->width());     CPPUNIT_ASSERT_EQUAL((unsigned int)(200), m_image->height());     CPPUNIT_ASSERT_EQUAL(runtime::Image::BGR_24, m_image->pixelType());     CPPUNIT_ASSERT_EQUAL(runtime::Variant::BGR_24_IMAGE, m_image->variant()); }
开发者ID:roteroktober,项目名称:stromx,代码行数:9,


示例14: GetImageStatisticsWithImageConnected

  void GetImageStatisticsWithImageConnected()  {    //create rules connection    auto statisticsNode = mitk::CreateImageStatisticsNode(m_statisticsContainer, "testStatistics");    CreateNodeRelationImage(m_statisticsContainer.GetPointer(), m_image.GetPointer());    auto standaloneDataStorage = mitk::StandaloneDataStorage::New();    standaloneDataStorage->Add(statisticsNode);    //rule: (image-->statistics), 1 connected image --> test return image statistics    mitk::ImageStatisticsContainer::ConstPointer statisticsWithImage;    CPPUNIT_ASSERT_NO_THROW(statisticsWithImage = mitk::ImageStatisticsContainerManager::GetImageStatistics(standaloneDataStorage.GetPointer(), m_image.GetPointer()));    CPPUNIT_ASSERT_EQUAL(statisticsWithImage->GetUID(), m_statisticsContainer->GetUID());    //new rule: (image2-->statistics2 AND mask --> statistics2)    CreateNodeRelationImage(m_statisticsContainer2.GetPointer(), m_image2.GetPointer());    CreateNodeRelationMask(m_statisticsContainer2.GetPointer(), m_mask.GetPointer());    auto statisticsNode2 = mitk::CreateImageStatisticsNode(m_statisticsContainer2, "testStatistics2");    standaloneDataStorage->Add(statisticsNode2);    //--> test return (still) image statistics (!= statistics2)    mitk::ImageStatisticsContainer::ConstPointer statisticsWithImageAgain;    CPPUNIT_ASSERT_NO_THROW(statisticsWithImageAgain = mitk::ImageStatisticsContainerManager::GetImageStatistics(standaloneDataStorage.GetPointer(), m_image.GetPointer()));    CPPUNIT_ASSERT_EQUAL(statisticsWithImageAgain->GetUID(), m_statisticsContainer->GetUID());    CPPUNIT_ASSERT_EQUAL(statisticsWithImageAgain->GetUID() != m_statisticsContainer2->GetUID(), true);    //--> test return image statistics 2    CPPUNIT_ASSERT_NO_THROW(statisticsWithImageAgain = mitk::ImageStatisticsContainerManager::GetImageStatistics(standaloneDataStorage.GetPointer(), m_image2.GetPointer(), m_mask.GetPointer()));    CPPUNIT_ASSERT_EQUAL(statisticsWithImageAgain->GetUID(), m_statisticsContainer2->GetUID());    CPPUNIT_ASSERT_EQUAL(statisticsWithImageAgain->GetUID() != m_statisticsContainer->GetUID(), true);    //add another newer statistic: should return this newer one    auto statisticsContainerNew = mitk::ImageStatisticsContainer::New();    CreateNodeRelationImage(statisticsContainerNew.GetPointer(), m_image.GetPointer());    auto statisticsNodeNew = mitk::CreateImageStatisticsNode(statisticsContainerNew, "testStatisticsNew");    standaloneDataStorage->Add(statisticsNodeNew);    statisticsContainerNew->Modified();    mitk::ImageStatisticsContainer::ConstPointer statisticsWithImageNew;    CPPUNIT_ASSERT_NO_THROW(statisticsWithImageNew = mitk::ImageStatisticsContainerManager::GetImageStatistics(standaloneDataStorage.GetPointer(), m_image.GetPointer()));    CPPUNIT_ASSERT_EQUAL(statisticsWithImageNew->GetUID(), statisticsContainerNew->GetUID());    CPPUNIT_ASSERT_EQUAL(statisticsWithImageNew->GetUID() != m_statisticsContainer->GetUID(), true);  }
开发者ID:Cdebus,项目名称:MITK,代码行数:44,


示例15: Save

void RecTestCase::TestContactList(){    recContactList record1;    record1.FSetID( 0 );    record1.FSetIndID( 3 );  // Doesn't exist so will cause an exception on Save()#if ALLOW_SQL_MEMORY_LEAK    // id = 0 so create new record and set id to new value.    CPPUNIT_ASSERT_THROW( record1.Save(), wxSQLite3Exception );#endif    recIndividual ind(0);    ind.FSetID(3);    CPPUNIT_ASSERT_NO_THROW( ind.Save() );    CPPUNIT_ASSERT_NO_THROW( record1.Save() );    idt id = record1.FGetID();    CPPUNIT_ASSERT( id > 0 );    recContactList record2;    record2.FSetID( record1.FGetID() );    CPPUNIT_ASSERT_NO_THROW( record2.Read() );    CPPUNIT_ASSERT( record1 == record2 );    record1.FSetIndID( 0 );    // id exists, so amend record leaving id to old value.    CPPUNIT_ASSERT_NO_THROW( record1.Save() );    CPPUNIT_ASSERT( record1.f_id == id );    CPPUNIT_ASSERT_NO_THROW( record2.Read() );    CPPUNIT_ASSERT( record1 == record2 );    record1.FSetID( 999 );    record1.FSetIndID( 3 );    // id = 999 which doesn't exists, so create new record with no change to id.    CPPUNIT_ASSERT_NO_THROW( record1.Save() );    CPPUNIT_ASSERT( record1.FGetID() == 999 );    record2.FSetID( record1.FGetID() );    CPPUNIT_ASSERT_NO_THROW( record2.Read() );    CPPUNIT_ASSERT( record1 == record2 );    record1.FSetID( 0 );    record1.FSetIndID( 0 );    CPPUNIT_ASSERT_NO_THROW( record1.Save() );    CPPUNIT_ASSERT( record1.FGetID() != 0 );    CPPUNIT_ASSERT( record1.Exists() == true );    CPPUNIT_ASSERT_NO_THROW( record1.Delete() );    CPPUNIT_ASSERT( record1.Exists() == false );    CPPUNIT_ASSERT( recContactList::Exists( 999 ) == true );    recContactList::Delete( 999 );    CPPUNIT_ASSERT( recContactList::Exists( 999 ) == false );}
开发者ID:nickmat,项目名称:thefamilypack,代码行数:49,


示例16: CPPUNIT_ASSERT_NO_THROW

void SerialTest::SetDataBits() {	Serial *serial = NULL;	unsigned int data_bits[] = { 5, 6, 7, 8, 0};	// create serial object	CPPUNIT_ASSERT_NO_THROW(serial = new Serial("/dev/ttyS1"));	// perform data bit setting tests	for (unsigned int i=0; data_bits[i]!=0; i++) {		CPPUNIT_ASSERT_NO_THROW(serial->SetDataBits(data_bits[i]));		CPPUNIT_ASSERT_EQUAL(data_bits[i], serial->DataBits());	}	CPPUNIT_ASSERT_THROW(serial->SetDataBits(100), std::runtime_error);	// destroy serial object	delete serial;	CPPUNIT_ASSERT(signal_catcher.StringSignalsReceived(0));}
开发者ID:ivannavarrete,项目名称:satori,代码行数:19,


示例17: CPPUNIT_ASSERT_NO_THROW

void IWAFieldTest::testRepeated(){  IWAUInt64Field field;  CPPUNIT_ASSERT_NO_THROW(field.parse(makeStream(BYTES("/x1/x4/x8")), 3));  const uint64_t expected[] = {1, 4, 8};  const std::deque<uint64_t> &values = field.repeated();  CPPUNIT_ASSERT_EQUAL(ETONYEK_NUM_ELEMENTS(expected), values.size());  CPPUNIT_ASSERT(std::equal(values.begin(), values.end(), expected));  CPPUNIT_ASSERT(std::equal(field.begin(), field.end(), expected));}
开发者ID:anuragkanungo,项目名称:libetonyek,代码行数:10,


示例18: sigmayxTest

/*****Test to assess the quality of the SigmaYX member of the TwoSampleStats****class which is designed to return the conditional uncertainty of y given x*/void xStats :: sigmayxTest (void){	gpstk::TwoSampleStats<double> sigmayxTest;	CPPUNIT_ASSERT_NO_THROW(sigmayxTest.SigmaYX());	CPPUNIT_ASSERT_DOUBLES_EQUAL(0.,sigmayxTest.SigmaYX(),1e-6);	sigmayxTest.Add(0.,0.);	sigmayxTest.Add(10.,10.);	sigmayxTest.Add(20.,20.);	CPPUNIT_ASSERT_DOUBLES_EQUAL(0.,sigmayxTest.SigmaYX(),1e-6);}
开发者ID:ianmartin,项目名称:GPSTk,代码行数:14,


示例19: correlationTest

/*****Test to assess the quality of the Correlation member of the TwoSampleStats****class which is designed to return the correlation between X and Y*/void xStats :: correlationTest (void){	gpstk::TwoSampleStats<double> correlationTest;	CPPUNIT_ASSERT_NO_THROW(correlationTest.Correlation());	CPPUNIT_ASSERT_DOUBLES_EQUAL(0.,correlationTest.Correlation(),1e-6);	correlationTest.Add(0.,0.);	correlationTest.Add(10.,10.);	correlationTest.Add(20.,20.);	CPPUNIT_ASSERT_DOUBLES_EQUAL(1.,correlationTest.Correlation(),1e-6);}
开发者ID:ianmartin,项目名称:GPSTk,代码行数:14,


示例20: MatrixImpl

        void MatrixWrapperTest::testSerializeEmpty()        {            m_matrix = new MatrixImpl(0, 100, Matrix::INT_8);            runtime::DirectoryFileOutput output(".");            output.initialize("MatrixTest_testSerializeEmpty");                        CPPUNIT_ASSERT_NO_THROW(m_matrix->serialize(output));            CPPUNIT_ASSERT_EQUAL(std::string(""), output.getText());        }
开发者ID:joccccc,项目名称:stromx,代码行数:10,


示例21: CPPUNIT_ASSERT_DOUBLES_EQUAL

void Point3DTest::testComplexMultiplications() {    Point3D resultPoint;    resultPoint = (*point111) * (maxCoordValue);    CPPUNIT_ASSERT_DOUBLES_EQUAL(maxCoordValue, resultPoint.getX(), maxTolerance);    CPPUNIT_ASSERT_DOUBLES_EQUAL(maxCoordValue, resultPoint.getY(), maxTolerance);    CPPUNIT_ASSERT_DOUBLES_EQUAL(maxCoordValue, resultPoint.getZ(), maxTolerance);    resultPoint = (*point111) * (minCoordValue);    CPPUNIT_ASSERT_DOUBLES_EQUAL(minCoordValue, resultPoint.getX(), maxTolerance);    CPPUNIT_ASSERT_DOUBLES_EQUAL(minCoordValue, resultPoint.getY(), maxTolerance);    CPPUNIT_ASSERT_DOUBLES_EQUAL(minCoordValue, resultPoint.getZ(), maxTolerance);    /* check limits */    CPPUNIT_ASSERT_NO_THROW((resultPoint = (*pointMax) * (1.0) ));    CPPUNIT_ASSERT_NO_THROW((resultPoint = (*pointMin) * (1.0) ));    CPPUNIT_ASSERT_THROW((resultPoint = (*pointMax) * (2.0) ), runtime_error);    CPPUNIT_ASSERT_THROW((resultPoint = (*pointMin) * (2.0) ), runtime_error);}
开发者ID:praman2s,项目名称:brics_3d,代码行数:19,


示例22: in

 void Id2DataMapTest::testSet() {     DataContainer in(new UInt8());     m_inputMap->set(0, in);          DataContainer out;     CPPUNIT_ASSERT_NO_THROW(out = m_inputMap->get(0));     CPPUNIT_ASSERT_EQUAL(in, out);          CPPUNIT_ASSERT_THROW(m_inputMap->set(10, in), WrongId); }
开发者ID:uboot,项目名称:stromx,代码行数:11,


示例23: cppMethodCall_passTwoInstancesTwice_noException

	void cppMethodCall_passTwoInstancesTwice_noException()	{		m_lua->run_chunk(/				"foo = function(o1,o2,o3,o4)/n"					"o3:a()/n"					"o4:b()/n"				"end");		A a;		B b;		CPPUNIT_ASSERT_NO_THROW( m_lua->call("foo",&a,&b,&a,&b) );	}
开发者ID:Hincoin,项目名称:mid-autumn,代码行数:11,


示例24: helper

void V2ToV3Test::applyPatchTest(){    ::fwAtoms::Object::sptr camObjV2 = ::fwAtoms::Object::New();    ::fwAtoms::Object::sptr camObjV3;    ::fwAtomsPatch::helper::setClassname(camObjV2, "::arData::Camera");    ::fwAtomsPatch::helper::setVersion(camObjV2, "2");    ::fwAtomsPatch::helper::Object helper(camObjV2);    helper.addAttribute("camera_id", ::fwAtoms::String::New("file"));    helper.addAttribute("description", ::fwAtoms::String::New("Videos/myVideo.mp4"));    ::fwAtoms::Sequence::sptr intrinsicParam = ::fwAtoms::Sequence::New();    intrinsicParam->push_back(::fwAtoms::Numeric::New(2596.78));    intrinsicParam->push_back(::fwAtoms::Numeric::New(2554.72));    intrinsicParam->push_back(::fwAtoms::Numeric::New(1020.74));    intrinsicParam->push_back(::fwAtoms::Numeric::New(500.189));    helper.addAttribute("intrinsic", intrinsicParam);    helper.addAttribute("width", ::fwAtoms::Numeric::New(1920));    helper.addAttribute("height", ::fwAtoms::Numeric::New(1080));    helper.addAttribute("camera_source", ::fwAtoms::String::New("FILE"));    helper.addAttribute("video_file", ::fwAtoms::String::New("Videos/myVideo.mp4"));    helper.addAttribute("stream_url", ::fwAtoms::String::New(""));    helper.addAttribute("max_framerate", ::fwAtoms::String::New("30"));    helper.addAttribute("pixel_format", ::fwAtoms::String::New("RGBA32"));    camObjV3 = ::fwAtoms::Object::dynamicCast(camObjV2->clone());    ::fwAtomsPatch::IPatch::NewVersionsType newVersions;    newVersions[camObjV2] = camObjV3;    auto patch = ::arStructuralPatch::arData::Camera::V2ToV3::New();    CPPUNIT_ASSERT_NO_THROW(patch->apply(camObjV2, camObjV3, newVersions));    CPPUNIT_ASSERT(camObjV3);    CPPUNIT_ASSERT(camObjV3->getAttribute("width"));    ::fwAtoms::Sequence::sptr intrinsicParam2 = ::fwAtoms::Sequence::dynamicCast(camObjV2->getAttribute("intrinsic"));    CPPUNIT_ASSERT_EQUAL(size_t(4), intrinsicParam2->size());    CPPUNIT_ASSERT_EQUAL(std::string("1920"), camObjV3->getAttribute("width")->getString());    CPPUNIT_ASSERT(camObjV3->getAttribute("height"));    CPPUNIT_ASSERT_EQUAL(std::string("1080"), camObjV3->getAttribute("height")->getString());    CPPUNIT_ASSERT(camObjV3->getAttribute("max_framerate"));    CPPUNIT_ASSERT_EQUAL(std::string("30"), camObjV3->getAttribute("max_framerate")->getString());    CPPUNIT_ASSERT(camObjV3->getAttribute("video_file"));    CPPUNIT_ASSERT_EQUAL(std::string("Videos/myVideo.mp4"), camObjV3->getAttribute("video_file")->getString());    CPPUNIT_ASSERT(camObjV3->getAttribute("stream_url"));    CPPUNIT_ASSERT(camObjV3->getAttribute("stream_url")->getString().empty());    CPPUNIT_ASSERT(camObjV3->getAttribute("camera_source"));    CPPUNIT_ASSERT_EQUAL(std::string("FILE"), camObjV3->getAttribute("camera_source")->getString());    CPPUNIT_ASSERT(camObjV3->getAttribute("pixel_format"));    CPPUNIT_ASSERT_EQUAL(std::string("RGBA32"), camObjV3->getAttribute("pixel_format")->getString());    CPPUNIT_ASSERT(camObjV3->getAttribute("scale"));    CPPUNIT_ASSERT_EQUAL(std::string("1"), camObjV3->getAttribute("scale")->getString());}
开发者ID:fw4spl-org,项目名称:fw4spl-ar,代码行数:54,



注:本文中的CPPUNIT_ASSERT_NO_THROW函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


C++ CPPUNIT_FAIL函数代码示例
C++ CPPUNIT_ASSERT_METRIC_TIMING_LE函数代码示例
万事OK自学网:51自学网_软件自学网_CAD自学网自学excel、自学PS、自学CAD、自学C语言、自学css3实例,是一个通过网络自主学习工作技能的自学平台,网友喜欢的软件自学网站。