Overview
Examples
Screenshots
Comparisons
Applications
Download
Documentation
Tutorials
Bazaar
Status & Roadmap
FAQ
Authors & License
Forums
Funding Ultimate++
Search on this site
Search in forums












SourceForge.net Logo
Home » U++ Library support » U++ Core » CHECK macro
Re: CHECK macro [message #6008 is a reply to message #5993] Fri, 27 October 2006 23:11 Go to previous messageGo to previous message
exolon is currently offline  exolon
Messages: 62
Registered: July 2006
Location: 53'21N 6'18W
Member
Hmm, you're right Mirek, that seems to work fine now. I was sure I tried this before and it caused many errors, so I renamed it in uppsrc instead.

However, with upp610-dev2 undefining CHECK before the unittest library does indeed work fine.

// trivial example
#include <Palindrome/Palindrome.h>
#undef CHECK
#include <UnitTest++.h>

TEST(CanInstantiate) {
	String test = "abc";
	Palindrome palindrome(test);
}

TEST(FalseForNonPalindrome) {
	String test = "abc";
	Palindrome palindrome(test);
	CHECK_EQUAL(palindrome.isPalindrome(), false);
}

TEST(TrueForPalindrome) {
	String test = "amanaplanacanalpanama";
	Palindrome palindrome(test);
	CHECK_EQUAL(palindrome.isPalindrome(), true);
}

int main(int, char **) {
	return UnitTest::RunAllTests();
}

Thanks, that saves me trouble Smile
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: strcmp() works with String?
Next Topic: dynamic loading of Ctrls using dli?
Goto Forum:
  


Current Time: Sun Apr 27 22:21:58 CEST 2025

Total time taken to generate the page: 0.00977 seconds