You are viewing a plain text version of this content. The canonical link for it is here.
Posted to log4cxx-user@logging.apache.org by Björn Carlsson <ma...@versionsupport.com> on 2005/03/02 12:31:21 UTC

Compilation, linking successful, but a few unit test failures

If I build the latest CVS files a get three unit test errors and two of 
them are different if I build using VS6 or VS.NET 2003.
Are the problems known? If not, any ideas what could cause them?
I have build the default configuration, static, debug

*VS.NET 2003*:
[exec] Run:  188   Failures: 3   Errors: 0


[exec] 1) test: XMLLayoutTestCase::locationInfo (F) line: 142 
D:\bedev\Logging\logging-log4cxx\tests\src\xml\xmllayouttestcase.cpp
[exec] assertion failed
[exec] - Expression: Compare::compare(FILTERED, 
LOG4CXX_FILE("witness/xmlLayout.2"))


[exec] 2) test: XMLLayoutTestCase::testCDATA (F) line: 181 
D:\bedev\Logging\logging-log4cxx\tests\src\xml\xmllayouttestcase.cpp
[exec] assertion failed
[exec] - Expression: Compare::compare(FILTERED, 
LOG4CXX_FILE("witness/xmlLayout.3"))


[exec] 3) test: FileTestCase::propertyRead (F) line: 107 
D:\bedev\Logging\logging-log4cxx\tests\src\filetestcase.cpp
[exec] equality assertion failed
[exec] - Expected: log4j.rootCategory=DEBUG, testAppender

[exec] - Actual  : log4j.rootCategory=DEBUG, testAppender

During build a got a few warnings, are those normal, or could they be an 
explanation to the unit test Failures?:
__________________________________________________________________________________________
untar-apriconv-src:
  [taskdef] Could not load definitions from resource 
net/sf/antcontrib/antcontrib.properties. It could not be found.
__________________________________________________________________________________________
[cc] 
D:\BeDev\Logging\logging-log4cxx\lib\apr-iconv-1.0.1\lib\iconv_ccs.c(47) 
: warning C4090: '=' : different 'const' qualifiers
__________________________________________________________________________________________
[cc] msxml.cpp
[cc] D:\BeDev\Logging\logging-log4cxx\src\msxml.cpp(262) : warning 
C4927: illegal conversion; more than one user-defined conversion has 
been implicitly applied
__________________________________________________________________________________________
[cc]         while calling the constructor 
'std::basic_string<_Elem,_Traits,_Ax>::basic_string(const _Elem *)'
[cc]         with
[cc]         [
[cc]             _Elem=wchar_t,
[cc]             _Traits=std::char_traits<wchar_t>,
[cc]             _Ax=std::allocator<wchar_t>
[cc]         ]
[cc]         C:\Program\Microsoft Visual Studio .NET 
2003\Vc7\include\xstring(358) : see declaration of 
'std::basic_string<_Elem,_Traits,_Ax>::__ctor'
[cc]         with
[cc]         [
[cc]             _Elem=wchar_t,
[cc]             _Traits=std::char_traits<wchar_t>,
[cc]             _Ax=std::allocator<wchar_t>
[cc]         ]
[cc]         and
[cc]         [
[cc]             _Elem=wchar_t,
[cc]             _Traits=std::char_traits<wchar_t>,
[cc]             _Ax=std::allocator<wchar_t>
[cc]         ]
__________________________________________________________________________________________
[cc] ShlDynamicLibraryManager.obj : warning LNK4221: no public symbols 
found; archive member will be inaccessible

__________________________________________________________________________________________
__________________________________________________________________________________________
*VS6* (secondary to me):
[exec] Run:  188   Failures: 1   Errors: 2


[exec] 1) test: FileTestCase::propertyRead (F) line: 107 
D:\bedev\Logging\logging-log4cxxVC6\tests\src\filetestcase.cpp
[exec] equality assertion failed
[exec] - Expected: log4j.rootCategory=DEBUG, testAppender

[exec] - Actual  : log4j.rootCategory=DEBUG, testAppender


[exec] 2) test: PatternParserTestCase::testNewWord (E)
[exec] uncaught exception of unknown type


[exec] 3) test: PatternParserTestCase::testNewWord2 (E)
[exec] uncaught exception of unknown type
-- 
/Björn Carlsson
VersionSupport.com <http://versionsupport.com>


Re: Compilation, linking successful, but a few unit test failures

Posted by Curt Arnold <ca...@apache.org>.
On Mar 2, 2005, at 5:31 AM, Björn Carlsson wrote:

>  If I build the latest CVS files a get three unit test errors and two  
> of them are different if I build using VS6 or VS.NET 2003.
>  Are the problems known? If not, any ideas what could cause them?
>  I have build the default configuration, static, debug
>
> VS.NET 2003:
>  [exec] Run:  188   Failures: 3   Errors: 0
>
>
>  [exec] 1) test: XMLLayoutTestCase::locationInfo (F) line: 142  
> D:\bedev\Logging\logging-log4cxx\tests\src\xml\xmllayouttestcase.cpp
>  [exec] assertion failed
>  [exec] - Expression: Compare::compare(FILTERED,  
> LOG4CXX_FILE("witness/xmlLayout.2"))
>
>
>  [exec] 2) test: XMLLayoutTestCase::testCDATA (F) line: 181  
> D:\bedev\Logging\logging-log4cxx\tests\src\xml\xmllayouttestcase.cpp
>  [exec] assertion failed
>  [exec] - Expression: Compare::compare(FILTERED,  
> LOG4CXX_FILE("witness/xmlLayout.3"))
>
>
>  [exec] 3) test: FileTestCase::propertyRead (F) line: 107  
> D:\bedev\Logging\logging-log4cxx\tests\src\filetestcase.cpp
>  [exec] equality assertion failed
>  [exec] - Expected: log4j.rootCategory=DEBUG, testAppender
>  [exec] - Actual  : log4j.rootCategory=DEBUG, testAppender


The first two were due to the wrong macro in log4cxx/spi/locationinfo.h  
which resulted in bad class and method names.  I should have used  
__FUNCSIG__ instead of __FUNCDNAME__ and has been fixed.  The VC6 build  
doesn't have the problem since VC6 doesn't provide a method to get the  
info so the test is skipped.

The last I haven't been able to reproduce, but looks like a line feed  
convention problem.


>
>  During build a got a few warnings, are those normal, or could they be  
> an explanation to the unit test Failures?:
>   
> _______________________________________________________________________ 
> ___________________
>  untar-apriconv-src:
>    [taskdef] Could not load definitions from resource  
> net/sf/antcontrib/antcontrib.properties. It could not be found.

Fully building apriconv requires ant-contrib.jar on the path.  I guess  
I could move the <taskdef> so it is only active when ant-contrib.jar is  
needed.


>   
> _______________________________________________________________________ 
> ___________________
>  [cc]  
> D:\BeDev\Logging\logging-log4cxx\lib\apr-iconv 
> -1.0.1\lib\iconv_ccs.c(47) : warning C4090: '=' : different 'const'  
> qualifiers

I think gcc 4.0 also warns about this and I need to report to the apr  
team.  However at this moment, log4cxx doesn't yet use apr-iconv, that  
should change shortly.


>   
> _______________________________________________________________________ 
> ___________________
>  [cc] msxml.cpp
>  [cc] D:\BeDev\Logging\logging-log4cxx\src\msxml.cpp(262) : warning  
> C4927: illegal conversion; more than one user-defined conversion has  
> been implicitly applied

Hadn't seen this one before.  msxml.cpp will hopefully disappear before  
too long, but might be after 0.9.8.
>   
> _______________________________________________________________________ 
> ___________________
>  [cc] ShlDynamicLibraryManager.obj : warning LNK4221: no public  
> symbols found; archive member will be inaccessible
>

I hadn't seen this one before.  I'm guessing it is a non-Windows  
platform .cpp file that has all of its contents #ifndef _WIN32'd out  
which leaves it with no symbols.

>   
> _______________________________________________________________________ 
> ___________________
>   
> _______________________________________________________________________ 
> ___________________
> VS6 (secondary to me):
>  [exec] Run:  188   Failures: 1   Errors: 2
>
>
>  [exec] 1) test: FileTestCase::propertyRead (F) line: 107  
> D:\bedev\Logging\logging-log4cxxVC6\tests\src\filetestcase.cpp
>  [exec] equality assertion failed
>  [exec] - Expected: log4j.rootCategory=DEBUG, testAppender
>
>  [exec] - Actual  : log4j.rootCategory=DEBUG, testAppender
>
>
>  [exec] 2) test: PatternParserTestCase::testNewWord (E)
>  [exec] uncaught exception of unknown type
>
>
>  [exec] 3) test: PatternParserTestCase::testNewWord2 (E)
>  [exec] uncaught exception of unknown type
>

This has been an elusive bug, it doesn't appear on any other compiler  
and seems to disappear in the debugger.  The tests check if custom  
conversion specifiers in pattern layouts work properly.  In the  
recently patternlayout update from log4j, users are able to add their  
own conversion patterns to the set of recognized patterns.  Something  
causes an exception when this is done in VC 6.