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

C++ printTestMessage函数代码示例

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

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



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

示例1: printTestMessage

bool Test::test_mazeReader01()
{
	bool isPassed = false;
	

	m_testNum++;


	printTestMessage(m_testNum, "MazeReader throws MazeCreationException if file doesn't exist");

	try
	{
		MazeReader mr("");
	}
	catch(MazeCreationException& mce)
	{
		isPassed = true;
	}
	catch(...)
	{
		std::cerr << "ERROR: Exception thrown was not MazeCreationException" << std::endl;
	}

	printPassFail(isPassed);

	return(isPassed);
}
开发者ID:chengyeh,项目名称:EECS268,代码行数:27,代码来源:Test.cpp


示例2: printTestMessage

bool Test::test2()
{
	bool isPassed = true;
	const int SIZE = 1000;
	const int LOW = -100;
	const int HIGH = 100;
	int* arr = Sorts<int>::createTestArray(SIZE, LOW, HIGH);

	printTestMessage(2, "createTestArray creates an array with values in the provided range");
	
	//check each value to ensure it's in range
	for(int i=0; i<SIZE && isPassed; i++)
	{
		if(arr[i] < LOW || arr[i] > HIGH)
		{
			isPassed = false;
			std::cerr << "ERROR! Excepted value from " << LOW << " to " << HIGH << ". Got " << arr[i];
			std::cerr << std::endl;
		}
	}
	
	delete[] arr;
	arr = nullptr;
	printPassFail(isPassed);
	return (isPassed);
}
开发者ID:KueiHsienChu,项目名称:EECS_268,代码行数:26,代码来源:Test.cpp


示例3: printTestMessage

bool Test::test_order03()
{
	bool isPassed = false;
	BSTI<int>* bst = new BinarySearchTree<int>();
	std::vector<int> input = {50, 25, 75, 10, 30, 65, 100}; 
	std::vector<int> correct = {10, 30, 25, 65, 100, 75, 50};
	std::vector<int> output;

	m_testNum++;

	printTestMessage(m_testNum, "vector returned by treeToVector(IN_ORDER) returns vector: {10, 30, 25, 65, 100, 75, 50}");

	loadVectorIntoTree(input, bst);
	output = bst->treeToVector(POST_ORDER);

	if(output == correct)
	{
		isPassed = true;
	}
	else
	{
		isPassed = false;
		std::cerr << "ERROR: expected ";
		printVector(correct);
		std::cerr << " got ";
		printVector(output);
		std::cerr << std::endl;	
	}	

	printPassFail(isPassed);

	delete bst;
	return(isPassed);
}
开发者ID:willashley23,项目名称:Binary-Search-Tree,代码行数:34,代码来源:Test.cpp


示例4: printTestMessage

bool Test_LinkedList::test16()
{
	LinkedList<int> list;
	bool isPassed = false;
	int trackedSize = 0;

	printTestMessage("size preserved by removeBack on populated list");

	//Remove front on every 3rd iteration, add otherwise.
	for(int i=0; i<TEST_SIZE; i++)
	{
		if( i>0 && i%3 == 0)
		{

			list.removeBack();
			trackedSize--;
		}
		else
		{

			list.addBack(i);
			trackedSize++;
		}
	}

	isPassed = trackedSize == list.size();
	printPassFail(isPassed);
	return (isPassed); 
}
开发者ID:bgivens,项目名称:eecs448-lab02,代码行数:29,代码来源:Test_LinkedList.cpp


示例5: printTestMessage

bool Test::test_sort26()
{
        bool isPassed = false;
        const int LOW = 0;
        const int HIGH = 5000;
        int* arr = Sorts<int>::createTestArray(TEST_SIZE, LOW, HIGH);
        double time = 0.0;

        m_testNum++;
        printTestMessage(m_testNum, "quickSortWithMedian sort completes in reasonable amount of time (0-2secs platform dependent) " + std::to_string(TEST_SIZE));

        time = Sorts<int>::sortTimer(Sorts<int>::quickSortWithMedian, arr, TEST_SIZE);

        std::cerr << "\nTime for quickSortWithMedian sort on " + std::to_string(TEST_SIZE) + " elements: " << time << " ";

        if(time<0 || time>2)
        {
                isPassed = false;
        }
        else
        {
                isPassed = true;
        }

        delete[] arr;
        arr = nullptr;

        printPassFail(isPassed);
        return (isPassed);
}
开发者ID:austinBailey5624,项目名称:oldCPlusPlusProjects,代码行数:30,代码来源:Test.cpp



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

专题导读
上一篇:
C++ printText函数代码示例发布时间:2022-05-30
下一篇:
C++ printTable函数代码示例发布时间:2022-05-30
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

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

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

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