• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

C++ TestType类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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

示例1: ASSERT

bool operator==(const TestType& lhs, const TestType& rhs)
{
    ASSERT(isalpha(lhs.datum()));
    ASSERT(isalpha(rhs.datum()));

    return lhs.datum() == rhs.datum();
}
开发者ID:AlisdairM,项目名称:bde,代码行数:7,代码来源:bslalg_arraydestructionprimitives.t.cpp


示例2: dumpStdMapStringString

static int dumpStdMapStringString()
{
    typedef std::map<std::string,std::string> TestType;
    TestType test;
    const TestType::value_type entry("K", "V");
    if (!optEmptyContainers) {
        test.insert(entry);
    }
    const int valueOffset = (char*)&(entry.second) - (char*)&entry;
    prepareInBuffer("std::map", "local.stdmapstringstring", "local.stdmapstringstring",
                    "std::basic_string<char,std::char_traits<char>,std::allocator<char> >@std::basic_string<char,std::char_traits<char>,std::allocator<char> >@std::less<int>@std::allocator<std::pair<const std::basic_string<char,std::char_traits<char>,std::allocator<char> >,std::basic_string<char,std::char_traits<char>,std::allocator<char> > > >");
    qDumpObjectData440(2, 42, testAddress(&test), 1, sizeof(std::string), sizeof(std::string), valueOffset, 0);
    fputs(qDumpOutBuffer, stdout);
    fputc('\n', stdout);
    return 0;
}
开发者ID:MECTsrl,项目名称:imx_mect,代码行数:16,代码来源:main.cpp


示例3:

//
// FREE OPERATORS
bool operator==(const TestType& lhs, const TestType& rhs)
{
    return lhs.datum() == rhs.datum();
}
开发者ID:azakhar,项目名称:bsl,代码行数:6,代码来源:bslalg_autoarraymovedestructor.t.cpp


示例4: swap

void swap(TestType<Alloc, Prefix>& a, TestType<Alloc, Prefix>& b) noexcept
{
    a.swap(b);
}
开发者ID:phalpern,项目名称:uses-allocator,代码行数:4,代码来源:copy_swap_helper.t.cpp


示例5:

bool operator!=(const TestType<Alloc, Prefix>& a,
                const TestType<Alloc, Prefix>& b)
{
    return a.value() != b.value();
}
开发者ID:phalpern,项目名称:uses-allocator,代码行数:5,代码来源:copy_swap_helper.t.cpp


示例6: main

int main(int argc, char** argv)
{
	RTPSLog::setVerbosity(EPROSIMA_DEBUGINFO_VERB_LEVEL);
	int type;
	if(argc > 1)
	{
//		RTPSLog::Info << "Parsing arguments: " << argv[1] << endl;
//		RTPSLog::printInfo();
		if(strcmp(argv[1],"1")==0)
			type = 1;
		else if(strcmp(argv[1],"2")==0)
			type = 2;
		else if(strcmp(argv[1],"3")==0)
			type = 3;
	}
	else
		type = WR;

	TestTypeDataType TestTypeData;
	DomainRTPSParticipant::registerType((DDSTopicDataType*)&TestTypeData);

	RTPSParticipantAttributes PParam;
	PParam.defaultSendPort = 10042;
	PParam.discovery.use_SIMPLE_RTPSParticipantDiscoveryProtocol = false;
	RTPSParticipant* p = DomainRTPSParticipant::createRTPSParticipant(PParam);

	switch(type)
	{
	case 1:
	{
		PublisherAttributes PParam;
		PParam.historyMaxSize = 20;
		PParam.topic.topicKind = WITH_KEY;
		PParam.topic.topicDataType = "TestType";
		PParam.topic.topicName = "Test_topic";
		Publisher* pub1 = DomainRTPSParticipant::createPublisher(p,PParam);
		Publisher* pub2 = DomainRTPSParticipant::createPublisher(p,PParam);
		SubscriberAttributes Sparam;
		Sparam.historyMaxSize = 50;
		Sparam.topic.topicDataType = std::string("TestType");
		Sparam.topic.topicName = std::string("Test_topic");
		Sparam.topic.topicKind = NO_KEY;
		Locator_t loc;
		loc.kind = 1;
		loc.port = 10467;
		Sparam.unicastLocatorList.push_back(loc); //Listen in the 10469 port
		Subscriber* sub = DomainRTPSParticipant::createSubscriber(p,Sparam);

		loc.set_IP4_address(127,0,0,1);
		loc.port = 10466;
		pub1->addReaderLocator(loc,true);
		pub2->addReaderLocator(loc,true);
		TestType tp1,tp2,tp_in;
		SampleInfo_t info;
		COPYSTR(tp1.name,"Obje1");
		COPYSTR(tp2.name,"Obje2");
		tp1.value = 0;
		tp1.price = 1.3;
		tp2.value = 0;
		tp2.price = -1.3;
		int n;
		cout << "Enter number to start: ";
		cin >> n;
		for(uint i = 0;i<10;i++)
		{
			tp1.value++;
			tp1.price *= (i+1);
			tp2.value++;
			tp2.price *= (i+1);
			pub1->write((void*)&tp1);
			pub2->write((void*)&tp2);
			if(pub1->getHistoryElementsNumber() >= 0.8*Sparam.historyMaxSize)
				pub1->removeMinSeqChange();
			if(pub2->getHistoryElementsNumber() >= 0.8*Sparam.historyMaxSize)
				pub2->removeMinSeqChange();
			if(i==8)
			{
				pub1->dispose((void*)&tp1);
				pub1->unregister((void*)&tp1);
				pub2->dispose((void*)&tp2);
				pub2->unregister((void*)&tp2);
				COPYSTR(tp1.name,"Obje3");
				tp1.value = 0;
				tp1.price = 1.5;
				COPYSTR(tp2.name,"Obje4");
				tp2.value = 0;
				tp2.price = 1.5;
			}
			if(sub->getHistoryElementsNumber() >= 1)
			{
				cout << "Taking from subscriber" <<endl;
				if(sub->readNextData((void*)&tp_in,&info))
					tp_in.print();
				cout << "Subscriber History has now: " << sub->getHistoryElementsNumber() << " elements "<<endl;
			}
		}
		cout << "Sleeping 3 seconds"<<endl;
		my_sleep(3);
		cout << "Slept for 3 seconds"<< endl;
		while(sub->takeNextData((void*)&tp_in,&info))
//.........这里部分代码省略.........
开发者ID:dhood,项目名称:Fast-RTPS,代码行数:101,代码来源:StatelessTest.cpp


示例7: testAll

inline int testAll( const typename TestType::Scalar tolerance = 1e-6 )
{
    TestType test;
    auto uniformTab = test.createUniformTabulatedFunction(TestType::testFn1);
    auto uniformXTab = test.createUniformXTabulatedFunction(TestType::testFn1);
    if (!test.compareTables(uniformTab, uniformXTab, TestType::testFn1, tolerance))
        return 1;

    uniformTab = test.createUniformTabulatedFunction(TestType::testFn2);
    uniformXTab = test.createUniformXTabulatedFunction(TestType::testFn2);
    if (!test.compareTables(uniformTab, uniformXTab, TestType::testFn2, tolerance))
        return 1;

    uniformTab = test.createUniformTabulatedFunction(TestType::testFn3);
    uniformXTab = test.createUniformXTabulatedFunction(TestType::testFn3);
    if (!test.compareTables(uniformTab, uniformXTab, TestType::testFn3, /*tolerance=*/1e-2))
        return 1;

    uniformXTab = test.createUniformXTabulatedFunction2(TestType::testFn3);
    if (!test.compareTableWithAnalyticFn(uniformXTab,
                                    -2.0, 3.0, 100,
                                    -4.0, 5.0, 100,
                                    TestType::testFn3,
                                    /*tolerance=*/1e-2))
        return 1;

    // CSV output for debugging
#if 0
    int m = 100;
    int n = 100;
    Scalar xMin = -3.0;
    Scalar xMax = 4.0;

    Scalar yMin = -1;
    Scalar yMax = 1;
    for (int i = 0; i < m; ++i) {
        Scalar x = xMin + Scalar(i)/m * (xMax - xMin);

        for (int j = 0; j < n; ++j) {
            Scalar y = yMin + Scalar(j)/n * (yMax - yMin);

            std::cout << x << " "
                      << y << " "
                      << uniformXTab->eval(x,y,true) << "\n";
        }
        std::cout << "\n";
    }
#endif
    return 0;
}
开发者ID:chflo,项目名称:opm-material,代码行数:50,代码来源:test_2dtables.cpp


示例8: checkConstructionEquiv

bool checkConstructionEquiv(TestType& T, TestType& U)
    // check that 'T' and 'U' where initialized in the exact same manner.
{
    return T.checkConstructEquiv(U);
}
开发者ID:MIPS,项目名称:external-libcxx,代码行数:5,代码来源:uses_alloc_types.hpp



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C++ TestTypedefs类代码示例发布时间:2022-05-31
下一篇:
C++ TestTransactionBuilder类代码示例发布时间:2022-05-31
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap