Re: [Cppunit-devel] TestSuiteBuilder & type info...
Brought to you by:
blep
From: Bastiaan B. <bas...@li...> - 2001-05-20 23:25:21
|
Baptiste Lepilleur wrote: -8<-- > > They only thing we need (at least for the TestSuiteBuilder) is the fully > > qualified class name of the Fixture. In case of the macros we already > > got that. > You don't need to specify the full name in the macro. This would be hell when > you need five lines of code to specify that name. Even if you do, you don't get > the actual template parameter type. > > For example: > template<class StringType> > class StringTest; > > Test *testStringChar = StringTest<char>::suite(); > Test *testStringWChar = StringTest<wchar_t>::suite(); > > In the macro you would get the same name for both suite, with RTTI you get > StringTest<char> and StringTest<unsigned short> (with VC++), which is very > useful when one fail but not the other. > > This become important when you have 4 or 5 parameters which might themself be > template (see this month expert column on generic programming in cuj for > example: http://www.cuj.com/experts/1906/alexandr.htm? > topic=experts&topic=experts ) > OK, finally I start to understand what you mean! :-) I've mostly been doing Java programming the last few years. No generics there, so I'm not too intimate with those and some other C++ features. Thanks for the C++ Journal link. Interesting information, the author is pretty sick bastard though: calling writing a dozen basic_string implementations 'fun' :-D I must be a C++ wimp ;-) --8<-- > I'm not saying that on windows you should only use RTTI. If you do a project > that might be ported to Unix then you must not use RTTI. But RTTI provides > useful functionnality when working with template and namespace and when you > know that you will never go for another platform with a project you might as > well use them. I don't care what people do on their own projects: they should be free to keep any platform dependencies they want. My worry is that the more platform dependent features get into CppUnit the more difficult it becomes to maintain: people on other platforms cannot check whether they break these features, more code than neccessary may come to depend on it, etc. ,etc. > > I've added a configuration to VC++ projects that do not use RTTI (that how I > found out that AutoRegisterSuite did not work without RTTI). > It will be in this evening commit too. > OK, do what's necessary for the RTTI features. Now that I understand how it may be useful, I would not want to keep excluding it from the project. > > > Do you mean removal of the 'registerFactory( TestFactory *factory )' or > > the > > whole class? > > The registerFactory method is used in AutoRegisterSuite.h and > > HostAppDoc, so > > thes would be affected too. Please explain, or hack at will. > Euhh... I completly forgot it was used but I've done a workaround. see > somewhere above. > > > g++ isn't as bad as the standard allows: the type_info name does not > > change > > between runs (and not even compilations AFAIK). But the mangled names > > have > > changed between 2.91, 2.95 and 2.96+. > OK. This is better than I though it was. Yet, not very usable for cppunit. > Indeed, it isn't. I'll see if I can get the reasoning behind from one of the g++ folks. > > > OK, as long as the name is only interpreted by humans, we can get away > > with the > > variance in the name. But once the name ends up being processed > > automatically > > somewhere, e.g. for multiplatform regression reporting, we're can run > > into > > trouble. > If I were to do multiplatform, I think I would name the test by hand to > ensure that they have the same name. That is the cost of multiplatform, you > must stick to the lowest common factor. The problem is often to find that > lowest common factor. For cppunit, it is easily identified: do not use RTTI if > you are doing multiplatform. We just have to stick it somewhere in the > documentation (I'll put it in TestSuiteBuilder at the current time). But I > would put it somewhere else. This fact is binded to the CU_USE_TYPEINFO macro, > not TestSuiteBuilder. Any Suggestions on where to put that ? > With the TypeInfoHelper class? Bastiaan > > --- > Baptiste Lepilleur <gai...@fr...> > http://gaiacrtn.free.fr/index.html > Language: English, French > > _______________________________________________ > Cppunit-devel mailing list > Cpp...@li... > http://lists.sourceforge.net/lists/listinfo/cppunit-devel |