cppunit-devel Mailing List for CppUnit - C++ port of JUnit (Page 26)
Brought to you by:
blep
You can subscribe to this list here.
2001 |
Jan
|
Feb
|
Mar
|
Apr
(21) |
May
(96) |
Jun
(109) |
Jul
(42) |
Aug
(6) |
Sep
(106) |
Oct
(60) |
Nov
(20) |
Dec
(6) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2002 |
Jan
(7) |
Feb
(11) |
Mar
(49) |
Apr
(124) |
May
(30) |
Jun
(37) |
Jul
(53) |
Aug
(33) |
Sep
(21) |
Oct
(22) |
Nov
(19) |
Dec
(15) |
2003 |
Jan
(34) |
Feb
(25) |
Mar
(11) |
Apr
(12) |
May
(16) |
Jun
(24) |
Jul
(23) |
Aug
(23) |
Sep
(42) |
Oct
(7) |
Nov
(32) |
Dec
(33) |
2004 |
Jan
(41) |
Feb
(41) |
Mar
(24) |
Apr
(25) |
May
(18) |
Jun
(13) |
Jul
(11) |
Aug
(15) |
Sep
(22) |
Oct
(10) |
Nov
(15) |
Dec
(9) |
2005 |
Jan
(4) |
Feb
(15) |
Mar
(11) |
Apr
(16) |
May
(29) |
Jun
(17) |
Jul
(27) |
Aug
(12) |
Sep
(9) |
Oct
(10) |
Nov
(5) |
Dec
(6) |
2006 |
Jan
(2) |
Feb
(6) |
Mar
(7) |
Apr
(2) |
May
(1) |
Jun
(5) |
Jul
(8) |
Aug
(6) |
Sep
(10) |
Oct
(11) |
Nov
(15) |
Dec
(2) |
2007 |
Jan
(12) |
Feb
(22) |
Mar
(10) |
Apr
(7) |
May
(1) |
Jun
(8) |
Jul
(4) |
Aug
(1) |
Sep
(2) |
Oct
(1) |
Nov
|
Dec
|
2008 |
Jan
|
Feb
(7) |
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
2009 |
Jan
|
Feb
|
Mar
(1) |
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
(7) |
Dec
|
2010 |
Jan
(1) |
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
2012 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
(1) |
Sep
|
Oct
|
Nov
|
Dec
|
2014 |
Jan
|
Feb
(1) |
Mar
(1) |
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
From: MRS A. H. <aba...@ya...> - 2003-02-19 23:58:48
|
Dear=2C I am Hajia Mariam Abacha=2C wife of Nigeria former head of state=3B Late General Sani Abacha=2C i wish to seek your assistance in the below contexts as a brother in the same faith and belief in islam=2C You must have heard over the media reports on the recovery of various sums of money deposited by my late husband with various security firms=2ESome companies willingly gave up their secret and disclosed our money confidently lodged there=2C or many=2Coutright blackmail=2E Infact the total sum discovered by the government so far is in the tune of $600=2C000=2C000=2E00 Million USD and they are not relenting to make me and my family suffer and poor for life=2E Your contact was given to me by islamic guest book=2C which i also sign=2C and after going through your profile=2C i decided to seek for your assistance as a good brother in the faith=2C kindly assist me in receiving into your account the sum of $25=2C300=2C000=2E00 Million USD willed and deposited safely=2C in my favour by my late husband=2E This money is currently kept in Europe=2E My only drive to survive with my family is to reach for help at this point of my predicament=2EAll our traveling documents have been seized by the government thereby preventing us from traveling and all the local and international outfit of our business empire seized=2E This sum of money is our only hope to stay alive=2E I have agreed to compensate you with 15% of the total deposit when you finally take delivery of the money in your account on my behalf=2Ethis transaction is risk free as you are not known to the nigeria government and you are to deal directly with the organisation in custody of the our funds on our behalf=2E Please respond to me at hajiaabacha4you=40yahoo=2Ecom for details=2Cit is imperative that you keep all our communication to your self=2Eon receipt of your response=2Ci will forward to you full details that will facilitate you clear the money on our behalf=2E As I await your response=2E Salaam=2C Hajia Mariam Abacha |
From: Duane M. <dua...@ma...> - 2003-02-13 23:23:17
|
--- At Thu, 13 Feb 2003 17:12:47 -0600, Dave Glowacki wrote: >If I try to do something like this: > > const char *sample = "Sample String"; > > char copy[16]; > strcpy(copy, sample); > CPPUNIT_ASSERT_EQUAL_MESSAGE("Identical strings are not equal", > (const char *)copy, sample); > >I end up getting an assertion like this: > > charcompare.cpp:15:Assertion > Test name: CharCompare::testCompare > equality assertion failed > - Expected: Sample String > - Actual : Sample String > - Identical strings are not equal > >Is there a variant of CPPUNIT_ASSERT_EQUAL macro which can compare >C strings? Extra points if it can compare a 'char[]' and a 'char *'! You are comparing pointers. The pointers are not equal. Convert them to std::string and compare them. std::string sample = "Sample String"; std::string copy = sample; CPPUNIT_ASSERT_EQUAL_MESSAGE("Identical strings are not equal", copy, sample); Welcome to C++ :-) ...Duane |
From: Dave G. <dg...@hy...> - 2003-02-13 23:13:04
|
If I try to do something like this: const char *sample = "Sample String"; char copy[16]; strcpy(copy, sample); CPPUNIT_ASSERT_EQUAL_MESSAGE("Identical strings are not equal", (const char *)copy, sample); I end up getting an assertion like this: charcompare.cpp:15:Assertion Test name: CharCompare::testCompare equality assertion failed - Expected: Sample String - Actual : Sample String - Identical strings are not equal Is there a variant of CPPUNIT_ASSERT_EQUAL macro which can compare C strings? Extra points if it can compare a 'char[]' and a 'char *'! |
From: Bart W. <whi...@ll...> - 2003-02-13 00:33:13
|
Actually, Thomas has a good point. The cookbook example has several problems that cause it to not compile. Read the comments within my attachments to see where the cookbook led you astray. Build like this: g++ -c testrunner.cpp g++ -c complexTestSuite.cpp g++ -o testrunner testrunner.o complexTestSuite.o -lcppunit Then just run ./testrunner You may need -L or -I flags to g++ if you installed cppunit someplace non-standard. Hope this helps. -- Bart Whiteley Computer Scientist voice: (925) 423-2249 National Atmospheric Release Advisory Center FAX: (925) 423-8274 Lawrence Livermore National Laboratory email: whi...@ll... P.O. Box 808, Livermore, CA 94551-0808 MS: L-103 |
From: Cremin, P. <pc...@or...> - 2003-02-13 00:00:23
|
I assume you are referring to the CppUnit Cookbook? http://cppunit.sourceforge.net/cppunit_cookbook.html#cppunit_cookbook If you take the code directly from that site I believe it will compile. Also, in the CppUnit source you downloaded look in cppunit\examples. There you will find a examples.dsw. Open that up and check out 'hierarchy classes' which has a Boardgame with CppUnit working on it. I wouldn't expect too much to be done about additional documentation. CppUnit is free, and additional docs will probable be developed by end users like me and you. Take a look at http://www.iunknown.com/Articles/fog0000000025.html For another example (gets into how to set up your project which can be a pain) Trust me though, I am a moron and I was able to get this working. Even added additional assertions and no operation test results. Good Luck, Patrick Cremin =20 -----Original Message----- From: Thomas Zander [mailto:za...@pl...]=20 Sent: Wednesday, February 12, 2003 5:23 PM To: cpp...@li... Subject: [Cppunit-devel] examples on webpage. Hi, trying to follow your examples on the website I was confused and disillusioned by the bad sourcecode you provide. I understand that your page wants to explain the concepts, but it basically lacks one thing; producing a compiling file that I can actually run... Ok, lets start my argument again; and let me get to the problem in a bit. I want to try cppunit. So the first thing I do is I find out about the assertions you provide and then I want to get a really simple test running and compiling. This part is essential and if this does not work I want to spend 0 time trying to figure out other ideas like suite etc. The page I found provided a number of sourecode samples but none had a full listing that actually compiled. And reaching the end I found a main method, but that uses a lot of concepts I never heard of; but I can't understand the concepts without seeing a running example of a test. Confused? So was I, the problem with your pages is that I can only understand then when I know what it is you explain. Please provide for _EACH_ example code a single file that contains the whole test; including main and everything. Preferrably with an example gcc (or similar) call at the top. It is sooo much easier to understand what you are saying when I have the option to see it in the context of the whole... If I can just get one file to actually compile I might start using cppunit! Many thanx! ps. a page describing the differences between junit and cppunit would also be great. --=20 Thomas Zander ------------------------------------------------------- This sf.net email is sponsored by:ThinkGeek Welcome to geek heaven. http://thinkgeek.com/sf _______________________________________________ Cppunit-devel mailing list Cpp...@li... https://lists.sourceforge.net/lists/listinfo/cppunit-devel |
From: Thomas Z. <za...@pl...> - 2003-02-12 23:23:22
|
Hi, trying to follow your examples on the website I was confused and disillusioned by the bad sourcecode you provide. I understand that your page wants to explain the concepts, but it basically lacks one thing; producing a compiling file that I can actually run... Ok, lets start my argument again; and let me get to the problem in a bit. I want to try cppunit. So the first thing I do is I find out about the assertions you provide and then I want to get a really simple test running and compiling. This part is essential and if this does not work I want to spend 0 time trying to figure out other ideas like suite etc. The page I found provided a number of sourecode samples but none had a full listing that actually compiled. And reaching the end I found a main method, but that uses a lot of concepts I never heard of; but I can't understand the concepts without seeing a running example of a test. Confused? So was I, the problem with your pages is that I can only understand then when I know what it is you explain. Please provide for _EACH_ example code a single file that contains the whole test; including main and everything. Preferrably with an example gcc (or similar) call at the top. It is sooo much easier to understand what you are saying when I have the option to see it in the context of the whole... If I can just get one file to actually compile I might start using cppunit! Many thanx! ps. a page describing the differences between junit and cppunit would also be great. -- Thomas Zander |
From: mitsuko y. <pe...@ya...> - 2003-02-12 00:36:30
|
Hello CPP grus, We are using CppTest unit to test our code. Hierarchycal classes' testing works fine, but in the subclass, in each method, we are reading input data one by one as a test case. The problem is that it's counting all the repeated testcases as one event. How can I make it recognize the each input data is one testcase in the method? Any advice is much appreciated. Thank you, Michelle --------------------------------- Do you Yahoo!? Yahoo! Shopping - Send Flowers for Valentine's Day |
From: King D. <Ki...@tc...> - 2003-02-04 21:21:28
|
> My problem is that I have a "UnitTest" project that contains > the main() to > run the unit test from all other projects in the solution. The other > projects use CPPUNIT_TEST_SUITE_REGISTRATION() to register > their suites. > > > > Once the libraries from the other projects are created the > TestFactoryRegistry is lost, and I cannot use it in my > UnitTest main(). > > > > The post > http://sourceforge.net/mailarchive/message.php?msg_id=908942 > <http://sourceforge.net/mailarchive/message.php?msg_id=908942> > says the > below is an option: > > > > >Have your librairies publishing an > > >interface that provide an access to their TestFactoryRegistry. > > >For example, in suite1.lib project, you add: > > >TestFactoryRegistry &getSuite1Registry() { > > > return TestFactoryRegistry::getRegistry(); > > >} > > This would work, but would involve me having to include a ton > of header > files in my main. One of the stated purposes of having the > TestFactoryRegistry is to remove the "compilation bottleneck > caused by the > inclusion of all test case headers". My solution to that is to have each test project publish its suite name through the same way and use a different namespace for each project. So a foobar test project would have this in an include file: namespace FooBar { inline std::string suiteName() { return "FooBar"; } } That include file is included by the tests in the project, but is not included by the main routine, so the main routine has no compilation dependencies on the include file and so I did not have to add all the individual projects to the main routine's include search path. My main routine then looks something like this: namespace FooBar { extern std::string suiteName(); } namespace Quux { extern std::string suiteName(); } int main( int argc, char* argv[] ) { bool selfTest = (argc > 1) && (std::string("-selftest") == argv[1] ); using namespace CppUnit; TextTestRunner runner; runner.addTest( TestFactoryRegistry::getRegistry( FooBar::suiteName() ).makeTest() ); runner.addTest( TestFactoryRegistry::getRegistry( Quux::suiteName() ).makeTest() ); bool wasSucessful = runner.run( "", false, !selfTest ); if( selfTest ) { CppUnit::CompilerOutputter outputter( runner.result(), std::cerr ); outputter.write(); } return wasSucessful ? 0 : 1; } Because we have references from the main routine to an element in each static library, that library does get included into the link, and we have done it without actually requiring the main routine to do a compile time include which reduces rebuilds and simplifies the set up of the main routine project. This is not ideal, but I have not found any better solution that allows you to group tests into different projects that build static libraries. If Micro$oft had a flag to tell the linker not to optimize away code that is not referenced from the main project this would be unnecessary. I have found no way to accomplish this after much study. Ideally what I would like is to be enable/disable groups of tests simply by saying that the main project depends on them in VC++. -- Dale King |
From: Baptiste L. <gai...@fr...> - 2003-02-04 09:22:53
|
This issue is easily solved by using CppUnit DLL instead of the static = library. Also, if you go the other way (explicitely exporting the test = factory), you only need to do that once per library. Thoses headers = never change, so you don't have any compilations bottleneck. Baptiste. ----- Original Message -----=20 From: Cremin, Patrick=20 To: 'cpp...@li...'=20 Sent: Tuesday, February 04, 2003 1:20 AM Subject: [Cppunit-devel] TestFactoryRegistry <I am using MS .NET> My problem is that I have a "UnitTest" project that contains the = main() to run the unit test from all other projects in the solution. The = other projects use CPPUNIT_TEST_SUITE_REGISTRATION() to register their = suites. Once the libraries from the other projects are created the = TestFactoryRegistry is lost, and I cannot use it in my UnitTest main(). The post = http://sourceforge.net/mailarchive/message.php?msg_id=3D908942 says the = below is an option: =20 >Have your librairies publishing an=20 >interface that provide an access to their TestFactoryRegistry. >For example, in suite1.lib project, you add: >TestFactoryRegistry &getSuite1Registry() { > return TestFactoryRegistry::getRegistry(); >} This would work, but would involve me having to include a ton of = header files in my main. One of the stated purposes of having the = TestFactoryRegistry is to remove the "compilation bottleneck caused by = the inclusion of all test case headers". |
From: Cremin, P. <pc...@or...> - 2003-02-04 00:21:41
|
<I am using MS .NET> My problem is that I have a "UnitTest" project that contains the main() to run the unit test from all other projects in the solution. The other projects use CPPUNIT_TEST_SUITE_REGISTRATION() to register their suites. Once the libraries from the other projects are created the TestFactoryRegistry is lost, and I cannot use it in my UnitTest main(). The post http://sourceforge.net/mailarchive/message.php?msg_id=908942 <http://sourceforge.net/mailarchive/message.php?msg_id=908942> says the below is an option: >Have your librairies publishing an >interface that provide an access to their TestFactoryRegistry. >For example, in suite1.lib project, you add: >TestFactoryRegistry &getSuite1Registry() { > return TestFactoryRegistry::getRegistry(); >} This would work, but would involve me having to include a ton of header files in my main. One of the stated purposes of having the TestFactoryRegistry is to remove the "compilation bottleneck caused by the inclusion of all test case headers". |
From: Baptiste L. <gai...@fr...> - 2003-01-31 22:15:45
|
Sorry, I messed up with my mail reader settings and this mail end up in the wrong mailing list (I keep confusing the the cppunit and cpptool project :-( ). Baptiste. ----- Original Message ----- From: "Baptiste Lepilleur" <gai...@fr...> To: "CppUnit Developers" <cpp...@li...> Sent: Friday, January 31, 2003 10:52 PM Subject: [Cppunit-devel] TODO: bugs > I've found a couple of bugs while using the add-in. They have been added > to the todo: > > a.. [High] Bug: The code analysis failed to recognize a local variable > occurrence. > a.. Details: > // Fails to recognize the last occurrence of bigBuffer as a local > variable > { > std::vector<int> bigBuffer; > { > KTEST_ASSERT_EQUAL( index, bigBuffer[index] ); > } > } > > This file can be found in bug/LocaleVariableNotRecognized?.cpp. The is a > unit test for it: IdentifierResolverTest?::testBug1() > a.. Solutions: seems to be related to the existence of the inner > CompoundStatement? (recognized correctly if removed). > b.. Status: to do > a.. [High] Bug: VC6 add-in crash when analysing the source > bug/ParserCrash?.cpp. > a.. Details: > // Crash when trying to rename the last occurrence of bigBuffer. (from > the add-in, seems to be in the IdentifierResolver?). > { > const int bufferSize = 256000; > std::vector<int> bigBuffer; > bigBuffer.reserve( bufferSize ); > for ( int index =0; index < bufferSize; ++index ) > bigBuffer[ index ] = 0; > > > const char *byteBuffer = (char *)&bigBuffer[0]; > int recievedLength = 0; > int totalLength = sizeof(int) * bufferSize; > > > KTEST_ASSERT_EQUAL( index, bigBuffer[index] ); > } > > a.. Solutions: ? > b.. Status: to do > Notes: even though the second bug was constated while using the add-in, the > crash occurred during code analysis in IdentifierResolver. > > Baptiste. > > > > ------------------------------------------------------- > This SF.NET email is sponsored by: > SourceForge Enterprise Edition + IBM + LinuxWorld = Something 2 See! > http://www.vasoftware.com > _______________________________________________ > Cppunit-devel mailing list > Cpp...@li... > https://lists.sourceforge.net/lists/listinfo/cppunit-devel > |
From: Baptiste L. <gai...@fr...> - 2003-01-31 21:50:02
|
I've found a couple of bugs while using the add-in. They have been added to the todo: a.. [High] Bug: The code analysis failed to recognize a local variable occurrence. a.. Details: // Fails to recognize the last occurrence of bigBuffer as a local variable { std::vector<int> bigBuffer; { KTEST_ASSERT_EQUAL( index, bigBuffer[index] ); } } This file can be found in bug/LocaleVariableNotRecognized?.cpp. The is a unit test for it: IdentifierResolverTest?::testBug1() a.. Solutions: seems to be related to the existence of the inner CompoundStatement? (recognized correctly if removed). b.. Status: to do a.. [High] Bug: VC6 add-in crash when analysing the source bug/ParserCrash?.cpp. a.. Details: // Crash when trying to rename the last occurrence of bigBuffer. (from the add-in, seems to be in the IdentifierResolver?). { const int bufferSize = 256000; std::vector<int> bigBuffer; bigBuffer.reserve( bufferSize ); for ( int index =0; index < bufferSize; ++index ) bigBuffer[ index ] = 0; const char *byteBuffer = (char *)&bigBuffer[0]; int recievedLength = 0; int totalLength = sizeof(int) * bufferSize; KTEST_ASSERT_EQUAL( index, bigBuffer[index] ); } a.. Solutions: ? b.. Status: to do Notes: even though the second bug was constated while using the add-in, the crash occurred during code analysis in IdentifierResolver. Baptiste. |
From: Steve M. R. <ste...@vi...> - 2003-01-31 13:51:29
|
On Fri, Jan 24, 2003 at 08:08:39PM +0100, Baptiste Lepilleur wrote: > It seems that configure does not detect any of the following headers: > <strstream.h> > <strstream> > <sstream> > > You need at least one of those to use CppUnit (it defines ostringstream or a > similar class). > > Either STL are not installed and configure failed for some reasons. Examine the file "config.log" to find out what went wrong with configure. -S |
From: Philippe F. <P....@OB...> - 2003-01-31 12:20:37
|
> I appreciate your dislike of long, capitalized macros, but I do not > think polluting the namespace with lots of macros which look like method > calls is a good idea. It is certainly not a good idea, unless you know what are doing. I developed this for me only at the beginning, so I knew exactly what I was doing. > I believe CppUnit did that at one point in the > past until it was decided that was a bad idea. See > CPPUNIT_ENABLE_NAKED_ASSERT in include/cppunit/TestAssert.h. However, > perhaps that could be a feature rather than just for backwards > compatibility, so those who want to 'import' lots of unqualified > assertion macros can do so. If you define qualified names names for > your macros, eg CPPUNIT_PHIL_..., then you could add shorter macro names > protected by ifdef CPPUNIT_ENABLE_NAKED_ASSERT. Then everyone could use > your macros who does not want the short names, and others can allow the > short names wherever they want. Exactly. The point of my posting is not to include my contribution as is, but ask for inclusion of similar facilities. Naming the simple assert check() for example is a bad idea, the name is too casual. Maybe the sort asserts should be prefixed with cu. Anyway, I hope this gets considered for inclusion in the next release. regards, Philippe |
From: Gary G. <gr...@uc...> - 2003-01-28 17:13:00
|
I appreciate your dislike of long, capitalized macros, but I do not think polluting the namespace with lots of macros which look like method calls is a good idea. I believe CppUnit did that at one point in the past until it was decided that was a bad idea. See CPPUNIT_ENABLE_NAKED_ASSERT in include/cppunit/TestAssert.h. However, perhaps that could be a feature rather than just for backwards compatibility, so those who want to 'import' lots of unqualified assertion macros can do so. If you define qualified names names for your macros, eg CPPUNIT_PHIL_..., then you could add shorter macro names protected by ifdef CPPUNIT_ENABLE_NAKED_ASSERT. Then everyone could use your macros who does not want the short names, and others can allow the short names wherever they want. gary |
From: Philippe F. <P....@OB...> - 2003-01-28 13:29:25
|
> From: Baptiste Lepilleur [mailto:gai...@fr...] > > CppUnit 1.9.10 already provides similar functionalities > through the generic TestRunner class. Hi Baptiste. If you are coding a new version of CppUnit, I have some suggestion for it. There are a few things that I dislike in CppUnit, which has lead me to code my own testrunner and assertions. I attach the files so that you can look at it. The differences with CppUnit are explained in the headers, which I copy here: /** * I wrote this class because I was dissatisfied with the text runner of * CppUnit. This works with CppUnit 1.8.0 I don't think it work with any other version. * * The goal of PhilTestRunner was for me to make the output of the testing * more readable and useful. It has the following characteristics: * * - it prints the name of the suite being run and separate two suites with a * blank line, so that you know better in which suite you are. * * - it prints the name of the test being run, so that when you have some kind * of debug output, you know to which test it belongs. * * - the failures are reported in detail while the suite still runs, directly * in the offending test. This differs from CppUnit which reports them at * the end. This is very useful if you have test suites that take a long * time. By placing the most offending test in the first position of the * suite, you don't need to wait for the whole test to finish before * spotting and understanding the failure. * * - on windows, the failures are also printed in the Debug window, using * OutputDebugString. This output is in the Visual C++ debug format, so * that pressing F4 (even during test run) sets your cursor directly on the * right line, in the right file. Very useful! * * - it prints a short but nice summary at the end, with the number of test * run, failed, and the percentage. * * The output of a run looks like this: --- suite TestFoo + testOne + testTwo d:\software\cppunit-1.8.0\testunitexample\testfoo.cpp(40) : Failure! Expected: 7, but was: 2. + testThree d:\software\cppunit-1.8.0\testunitexample\testfoo.cpp(45) : Failure! Uh uh, this test failed --- suite TestMyClass * * All you need to use in this class is the PhilTestRunner. Ignore the other * classes, there are only used within PhilTestRunner. I package * everything in one header file and one source file to make distribution more * convenient. * * To use the PhilTestRunner, just do like with any other runner : PhilTestRunner runner; runner.addTest( CppUnit::TestFactoryRegistry::getRegistry().makeTest() ); return runner.run( "", false, true, true ); * * * Send any comment, bug, suggestion, patch to ph...@fr... * */ and /** * This is a set of replacements for the default asserts of CppUnit. This * works with CppUnit 1.8.0 . Thank to the architecture of CppUnit, it * integrates seemlessly. * * The differences are: * * - my asserts are shorter and easier to type because I do not prepend them * by CPPUNIT_ and because I use mainly non capitalised letters. This does * not respect the convention that macros should be in capitalised letters * but it saves me a lot of pain, so it is worthwile. * * - the order of equality assertion is reversed, because it is more intuitive * for me to have the actual value before the expected one. So * CPPUNIT_ASSERT_EQUALS( 1, a ) becomes checkEquals( a, 1 ) * * - I display the name of the expression being tested inside the failure, not * just the value that did not match. * * - for int equality asserts, I display the int value in decimal and * hexadecimal * * - I support native string equality tests, which avoids the following * drawbacks of CppUnit: * * 1. With Visual C++, CPPUNIT_ASSERT_EQUAL( std::string("a"), "a" ) * won't compile because the it does not know which template to use. * * 2. If you do a * char * s1 = "abcd"; char s2[10]; strcpy( s2, s1); CPPUNIT_ASSERT_EQUAL( s1, (char *) s2 ); * CppUnit will report a failure with the unhelpful message : * * "Expected: abcd, but was: abcd." * * This is because CppUnit has unintuitively compared the two pointers * instead of comparing the strings. My functions know how to cast a * (char *) to a string * * * - when displaying an error with a string, my strings are in quote, so that * you can see precicely where it begins and finish. No more * your-strings-are-not-equal-but-you-do-not-know-why-because-you-have- * not-seen-this-naughty-space-at-the-end-of-one-of-them. * * - for string equality asserts, I support case sensitive and insenstive * check. * * - I support also a assertion to test whether a string contains another one, * with adjustable case sensitivity * * - if you define QT_DLL, I support tests on QString too * * * This list of macros available are : * check( assertion ) for bool * checkEquals( actual, expected ) for int, long, double, std::string, QString and char * * checkNotEquals( actual, notExpected ) for the same types as checkEquals * checkDeltaEquals( doubleValue1, doubleValue2 ) for double * checkIEquals( s1, s2 ) for std::string, QString, (char *) * checkContains( s1, s2 ) for std::string, QString, (char *) * checkIContains( s1, s2 ) for std::string, QString, (char *) * * Send any bug, comment, suggestion, patch to ph...@fr... * */ It would probably make sense to add this to CppUnit. I am probably not the only one who have felt these problems. I know my colleagues prefer to use my addition than the standard CppUnit way. I attach the files since they are quite short. Could all people here provide feedback ? regards, Philippe |
From: Andrei M. <tr...@ma...> - 2003-01-26 10:22:06
|
Is there any documentation on installing CPPUnit in Visual Studio .NET? If there are no documentation, I can write a howto. For example, *.dsw and *.dsp should be converted into .Net format, and test plugin won't compile, as object model of visual studio has changed. But fortunately after some black magic CPPUnit start to work. Could you send a cc to tr...@ma... when you answer as I am not subscribed to the list. _________________________________________ Andrey Melnikov ICQ#: 29804514 |
From: Jean-Baptiste <pa...@ar...> - 2003-01-25 17:24:52
|
Hi Fred, Just finished :-)) beta version is online: http://www.art-online.com/category.aspx Careful ! keep it secret the grand opening is in February before Apocalypse. full text search engine .NET inside ;-) We're so worn out!... US team will leave tomorrow It's party time ! with the mastermind of ServerGroup (E.T) at Domaine de la Source... It's crazy ! "The Internet continues for him to be a metaphor of the divine, an agora of ethers." Tell Dan I say hello, we're impatient you come visit us in France. Bye Baptiste pa...@ar... >Hi Jean-Baptiste, >Have you finished your new project ? >Send me the address when ready >Talk t'ya later >Fred |
From: Baptiste L. <gai...@fr...> - 2003-01-24 19:06:55
|
It seems that configure does not detect any of the following headers: <strstream.h> <strstream> <sstream> You need at least one of those to use CppUnit (it defines ostringstream or a similar class). Either STL are not installed and configure failed for some reasons. Anyway, try to make a sample program to see which includes is available and tweak you config-auto.h as required. Tests concerning this includes can be found in include/cppunit/Portability.h, around line #180. Baptiste. ----- Original Message ----- From: <wa...@ma...> To: <cpp...@li...> Sent: Thursday, January 23, 2003 3:32 PM Subject: [Cppunit-devel] problem with install cppunit on cygwin > Hi: > I follow the install step in "instll-unxt" to install cppunit. > > First i enter ./configure --disable-shared on the shell of the cygwin. > > it runed without errors. Second, i press "make", errors occured, the shell > > printed "/../include/cppunit/Portability.h:81: #error Cannot define > > CppUnit::OStringStream." and the make stopped. I was eager to compile > > the package. Can you give a solution to me? or some advise? thank you > > very much. > > > Best Regards! > test dept. Eastcomtd > Lun Wang > office: 507 > tel(o): 86-10-62973322-5577 > the second Street,Shangdi Information Industry Base > Haidian District,Beijing,China > Post Code:100085 > NHM??. |
From: Linh T. <tru...@qu...> - 2003-01-24 10:31:34
|
Dear Sir, I am using cppunit for my program. Please show me how to write the = failure report into a file instead of display them on the result window. = Your help will be appreciated on the top. Hope to hear from you soon. Thanks alot. Best regards, Linh Truong |
From: Baptiste L. <gai...@fr...> - 2003-01-23 23:30:42
|
Some bug where introduced in the last release. Try to get the current CVS where they have been fixed. Baptiste. ----- Original Message ----- From: <Eri...@qi...> To: <cpp...@li...> Sent: Thursday, January 23, 2003 1:40 PM Subject: [Cppunit-devel] CPPUnit 1.9.10 - Problem running HostApp / CppUnitTestApp > Hi, > > I am currently thinking of automatic unit testing either by commercial > tools or by using a programmatic framework, which I can influence. A while > ago I played around with version 1.5 of cppunit provided by the xP-website. > Today I realized that there is a lot going on on cppunit development and > downloaded the snapshot 1.9.10. > I followed the instructions given in the documention to compile the projects > and setup the MSVC environment. In the next step I compiled the HostApp > example and ran it. Unfortunatly, I could not select a testsuite in the > TestRunner combobox. I debugged a little bit and found out, that there has > to be a history of tests in the registry. If there is no history, all > buttons besides the close button are disabled. I added an entry > "HistoryTest1" with value "All Tests". Now I can see this suite in the > combobox and run it. (I like the double-click feature very much! :) ) > I deleted all files and started from scratch using the documentation, only > to get this effect again. > Do I miss something? > > Best Regards, > Erik Steiner |
From: Baptiste L. <gai...@fr...> - 2003-01-23 23:25:14
|
Yes, it is. Please, check the last version of the cookbook (1.9.10), = where this error has been corrected. Baptiste. ----- Original Message -----=20 From: d=20 To: cpp...@li...=20 Sent: Wednesday, January 23, 2002 7:18 AM Subject: [Cppunit-devel] TestFactoryRegistry Hi! I' ve read the CppUnit Documentation yesterday very carefully. While I = was reading the chapter about the TestFactoryRegistry I asked my self if the passed parameter = at CPPUNIT_TEST_SUITE_REGISTRATION( ) should be ComplexNumberTest class. I have to know what is the right parameter, because I have to write a = summary about that page in German. Thanx, Ege |
From: Baptiste L. <gai...@fr...> - 2003-01-23 23:18:32
|
When using dll, you can use the test plug-in to automatically creates = the TestCollectorSuite. Those can be loaded using the PlugInManager. The = only thing left to be done is scanning the directory to load them. Also, not that the text based DllPlugInTester support any number of DLL = on the command line. Baptiste. ----- Original Message -----=20 From: Alexandre Carsac=20 To: cpp...@li...=20 Sent: Monday, January 20, 2003 11:13 AM Subject: [Cppunit-devel] TestCollector ? Perhaps it is not the good place for that.. Just wondering if with all the CppUnit framework (the windows one) we = can not make a TestCollector like JUnit based on each test DLL. I explain: creates a particular TestSuite called TestCollectorSuite that gather = all the existing DLL from a root directory and construct a hirarchical = suite of tests.=20 This could be automaticaly load all DLL tests from a root directory = instead of choosing a particular DLL (i think about the msvc6 GUI). good or bad idee ? |
From: Baptiste L. <gai...@fr...> - 2003-01-23 23:09:43
|
CppUnit 1.9.10 already provides similar functionalities through the generic TestRunner class. CppUnit only regards source code compatibility, which is already difficult enough to achieve. Thanks anyway, Baptiste. ----- Original Message ----- From: "Philippe FREMY" <P....@OB...> To: <cpp...@li...> Sent: Friday, January 17, 2003 11:17 AM Subject: [Cppunit-devel] ExtendedTextTestRunner > > Hi, > > > For my personal need, I have extended the CppUnit::TextUi::TestRunner. The > extension is very simple, the goal for me was just to be able to provide my > own outputter and progress listener. > > See: > > --- ExtendedTestRunner.h > > namespace CppUnit { > > class ExtendedTestRunner : public TextUi::TestRunner { > > public: > ExtendedTestRunner( Outputter *outputter =NULL, TestListener * > progressListener =NULL) > : TextUi::TestRunner( outputter), m_progressListener( > progressListener) { > if (m_progressListener == NULL) { > m_progressListener = new TextTestProgressListener(); > } > } > > virtual bool runTest( Test *test, > bool doPrintProgress ); > > virtual void setTestProgressListener( TestListener * listener) { > delete m_progressListener; > m_progressListener = listener; > } > > virtual void setTestResultCollector( TestResultCollector * result) { > delete m_result; > m_result = result; > } > > > protected: > TestListener * m_progressListener; > }; > > }; // CppUnit > > > ------- ExtendedTestRunner.cpp > > namespace CppUnit { > > bool > ExtendedTestRunner::runTest( Test *test, > bool doPrintProgress ) > { > if ( doPrintProgress ) > m_eventManager->addListener( m_progressListener ); > > test->run( m_eventManager ); > > if ( doPrintProgress ) > m_eventManager->removeListener( m_progressListener ); > return m_result->wasSuccessful(); > } > > }; > > ------------------------------ > > I don't remember if adding a virtual method and a new protected member > breaks binary compatbility. If not, I suggest to add my method directly the > TextUi::TestRunner . Else, I would be happy to see this small class included > directly into CppUnit. > > I have other personal improvements, but I won't talk about them until they > are ready. > > regards, > > Philippe |
From: Baptiste L. <gai...@fr...> - 2003-01-23 23:01:05
|
1) I'm not aware of anyway to avoid those issues at link time. You would probably be better of asking Oracle to provide a version of the library linked against the DLL runtime. 2) Not at the current time. I'm even amazed that you managed to get this working. Didn't you run in any problem concerning AfxGetApp() (returning NULL), which is used to store settings in the registry ? Baptiste. ----- Original Message ----- From: "Strebel, Dr. Oliver" <Oli...@Dr...> To: <cpp...@li...> Cc: "Geier, Roland" <Rol...@Dr...> Sent: Thursday, January 16, 2003 5:46 PM Subject: [Cppunit-devel] Static TestRunner Library Hi all! First of all I want to say a big THANK YOU for this very useful piece of software. It was of great help for me in another project. We are now using CppUnit with MFC TestRunner. In the present project we have to use an Oracle Library oci.lib which is compiled with the Mutlithreaded C-Runtime Library and not the Multithreaded DLL C-Runtime Library, resulting in the linker problems similar to those mentioned in the second question of your FAQ. This afternoon I managed to hack out quickly a static TestRunner-library using your source code by stripping away all the AFX_DLL stuff and was able to get it linked and working properly with my code. So I have two questions: 1. Is there a simpler way to overcome this awful library clashes at link time? 2. If not: Will there be a statically TestRunner library available in future releases? Sincerely yours, Dr. Oliver Strebel CC RCO TC Jürgen Ponto Platz 1 21. Floor 60301 Frankfurt Germany Tel.: 069/26316924 Fax: 069/26311838 E-Mail: Oli...@Dr... The opinions herein are my own and do not necessarily reflect those of Dresdner Bank AG. ------------------------------------------------------- This SF.NET email is sponsored by: Thawte.com Understand how to protect your customers personal information by implementing SSL on your Apache Web Server. Click here to get our FREE Thawte Apache Guide: http://ads.sourceforge.net/cgi-bin/redirect.pl?thaw0029en _______________________________________________ Cppunit-devel mailing list Cpp...@li... https://lists.sourceforge.net/lists/listinfo/cppunit-devel |