Hi,

I did some work on trac #85, but was only able to solve the build problems. The 
unit test harness crashes after running all the tests.

First, some comments on the fixes in the attached .diff:

1. blockallocator.t

Error: 
   libs/csutil/t/blockallocator.t: In member function `size_t 
csBlockAllocatorTest::Allocator<T>::get_block_count() const [with T = int]':
   libs/csutil/t/blockallocator.t:159:   instantiated from here
   libs/csutil/t/blockallocator.t:49: error: 'const struct 
csFixedSizeAllocator<4u, CS::Memory::AllocatorMalloc>::BlocksWrapper' has no 
member named 'GetSize'

Solution:
  Use "S::blocks.b.GetSize()".

2. eventqueue.t

Error:
  In file included from ./out/msysx86/debug/libs/csutil/t/eventqueue.cpp:11:
  libs/csutil/t/eventqueue.t: In member function `void 
csEventQueueTest::testPhaseHandlers()':
  libs/csutil/t/eventqueue.t:184: error: 'class csPartialOrder<csHandlerID>' 
has no member named 'Dump'

Solution:
  Comment out the call to 'Dump', since that method does not exist anymore and 
there are no comments suggesting any side effects.

3. objreg.t

Error:
  libs/csutil/t/objreg.t: In member function `void 
csObjectRegistryTest::testGet()':
  libs/csutil/t/objreg.t:184: error: cannot convert from base `iBase' to 
derived type `iString' via virtual base `iBase'
  libs/csutil/t/objreg.t:188: error: cannot convert from base `iBase' to 
derived type `iString' via virtual base `iBase'

Solution:
  Use 'dynamic_cast' instead of 'static_cast'.

4. inlining

Error:
  ./include/cssysdef.h: In destructor `CppUnit::TestFactory::~TestFactory()':
  ./include/cssysdef.h:711: sorry, unimplemented: inlining failed in call to 
'void operator delete(void*) throw ()': function not considered for inlining
  ./out/msysx86/debug/libs/csutil/t/inputdef.cpp:16: sorry, unimplemented: 
called from here

Solution:
  It seems that MinGW's gcc 3.4.5 does not like forced inlining at all. So, 
CS_FORCE_INLINE as well as CS_FORCEINLINE_TEMPLATEMETHOD have to be #defined as 
'inline' for this compiler release.



After these fixes, the unit test harness builds fine, and all tests succeed. 
However, the programm crashes on exit:

#0  0x0048a1bb in mutex_lock (m=0x0)
    at libs/csutil/ptmalloc/sysdeps/win32/malloc-machine.h:56
#1  0x0048ae2e in ptfree (mem=0x1810030)
    at libs/csutil/ptmalloc/ptmalloc3.c:884
#2  0x0046f172 in ptfree(void*) (P=0x1810038)
    at libs/csutil/ptmalloc_wrap.cpp:105
#3  0x005c78d3 in operator delete(void*) ()
#4  0x004551b5 in CppUnit::TestFactoryRegistry::~TestFactoryRegistry() (
    this=0x1810038) at TestFactoryRegistry.cpp:92
#5  0x0045507f in __tcf_0 ()
    at 
c:/coding/tools/msys/1.0/mingw/bin/../lib/gcc/mingw32/3.4.2/../../../../include/c++/3.4.2/bits/stl_tree.h:171
#6  0x77c09e24 in _libshell32_a_iname ()
#7  0x77c09ec5 in _libshell32_a_iname ()

Further investigation shows that ptmalloc's static variable 'state' 
(libs/csutil/ptmalloc/ptmalloc3.c:268) is NULL at this point, so I suppose it 
was destructed before CppUnit's default TestFactoryRegistry.

One possible solution would be to write a replacement for TestFactoryRegistry 
and its helper macros. But maybe there is an easier solution... so:

Does anyone know an easy fix for this problem?

Greetings,
Lukas E. (erluk)

Attachment: jam_check.diff
Description: Binary data

-------------------------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________
Crystal-main mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/crystal-main
Unsubscribe: mailto:[EMAIL PROTECTED]

Reply via email to