Hi,
I'm trying to understand and use Boost Unit Test Framework
in my project.
First, I did clean checkout from CVS and
I did complete build of Boost using VC++ 8.0.
Next, I started to learn Boost UTF from examples provided.
I created clean project with VC++ 8.0 and added first example
(boost\libs\test\example\unit_test_example_01.cpp).
I compiled and run it without any problems and I got results as expected.
There is only one thing I can't explain why I had not to add
library (e.g. libboost_unit_test_framework-vc80-mt-1_34.lib) to link
with. VC++ did not complain about missing libraries or unresolved
symbols. OK, magic :-)
Then, I tried to run rest of examples, unit_test_example_02.cpp
and unit_test_example_03.cpp, as explained above.
And here comes my problems I noticed with unit_test_example_02
and unit_test_example_03.
When I try to run compiled example from unit_test_example_02.cpp I get
memory leaks detected:
========== unit_test_example_02 - OUTPUT START ====================
D:\temp\bt\Debug>unit_example.exe
Running 1 test case...
d:/temp/bt/example.cpp(20): error in "free_test_function": check 2 == 1
failed
Detected memory leaks!
Dumping objects ->
{196} normal block at 0x003A6500, 16 bytes long.
Data: <, H d: > 2C 8D 48 00 01 00 00 00 01 00 00 00 C8 64 3A 00
{195} normal block at 0x003A64C8, 8 bytes long.
Data: < H `: > 0C 8D 48 00 D4 60 3A 00
{194} normal block at 0x003A6318, 52 bytes long.
Data: <@a: b: @a: > 40 61 3A 00 B8 62 3A 00 40 61 3A 00 00 00 01 00
{193} normal block at 0x003A62B8, 52 bytes long.
Data: <@a: @a: c: > 40 61 3A 00 40 61 3A 00 18 63 3A 00 01 00 00 00
{173} normal block at 0x003A6140, 52 bytes long.
Data: < b: b: c: > B8 62 3A 00 B8 62 3A 00 18 63 3A 00 CD CD CD CD
{172} normal block at 0x003A5E70, 4 bytes long.
Data: < > 00 00 01 00
{171} normal block at 0x003A61F8, 24 bytes long.
Data: < Z: `\: Z: > 18 5A 3A 00 60 5C 3A 00 18 5A 3A 00 00 00 01 00
{170} normal block at 0x003A6108, 12 bytes long.
Data: < a: a: > 08 61 3A 00 08 61 3A 00 CD CD CD CD
{169} normal block at 0x003A61A8, 32 bytes long.
Data: 50 F9 47 00 01 00 00 00 01 00 00 00 08 60 3A 00
{163} normal block at 0x003A6008, 8 bytes long.
Data: <0 G B > 30 F9 47 00 8C 94 42 00
{162} normal block at 0x003A5C60, 24 bytes long.
Data: < Z: Z: a: > 18 5A 3A 00 18 5A 3A 00 F8 61 3A 00 01 00 00 00
{161} normal block at 0x003A5BC0, 12 bytes long.
Data: < [: [: > C0 5B 3A 00 C0 5B 3A 00 CD CD CD CD
{160} normal block at 0x003A5C10, 32 bytes long.
Data: <Unit test exampl> 55 6E 69 74 20 74 65 73 74 20 65 78 61 6D 70 6C
{158} normal block at 0x003A5B20, 116 bytes long.
Data: <0 H H H > 30 1C 48 00 10 00 00 00 88 0B 48 00 8D 0B 48 00
{157} normal block at 0x003A5AE0, 20 bytes long.
Data: <`Z: Z: `Z: QI > 60 5A 3A 00 A0 5A 3A 00 60 5A 3A 00 90 51 49 00
{156} normal block at 0x003A5AA0, 20 bytes long.
Data: <`Z: `Z: Z: $RI > 60 5A 3A 00 60 5A 3A 00 E0 5A 3A 00 24 52 49 00
{155} normal block at 0x003A5A60, 20 bytes long.
Data: < Z: Z: Z: > A0 5A 3A 00 A0 5A 3A 00 E0 5A 3A 00 CD CD CD CD
{154} normal block at 0x003A5A18, 24 bytes long.
Data: <`\: `\: a: > 60 5C 3A 00 60 5C 3A 00 F8 61 3A 00 CD CD CD CD
{152} normal block at 0x003A59D8, 16 bytes long.
Data: < )W > 14 29 57 10 03 02 00 00 06 00 00 00 00 00 00 00
{151} normal block at 0x003A5FD0, 8 bytes long.
Data: < H > 90 90 48 00 CD CD CD CD
{150} normal block at 0x003A5FA0, 4 bytes long.
Data: < G > 80 FF 47 00
{149} normal block at 0x003A5EA0, 208 bytes long.
Data:
"Mateusz Loskot"
Hi,
Hi, Mateusz
I'm trying to understand and use Boost Unit Test Framework in my project. First, I did clean checkout from CVS and I did complete build of Boost using VC++ 8.0.
Next, I started to learn Boost UTF from examples provided. I created clean project with VC++ 8.0 and added first example (boost\libs\test\example\unit_test_example_01.cpp). I compiled and run it without any problems and I got results as expected.
There is only one thing I can't explain why I had not to add library (e.g. libboost_unit_test_framework-vc80-mt-1_34.lib) to link with. VC++ did not complain about missing libraries or unresolved symbols. OK, magic :-)
This is an autolinking in use. Get the latest docs from cvs and read compilation instruction for UTF. There is section there covering it now.
Then, I tried to run rest of examples, unit_test_example_02.cpp and unit_test_example_03.cpp, as explained above. And here comes my problems I noticed with unit_test_example_02 and unit_test_example_03. When I try to run compiled example from unit_test_example_02.cpp I get memory leaks detected:
[...] // problem decription skipped. I couldn't explain what you are expiriencing. Just one suggestion: make sure you link with proper library. Autolinking inforce proper name. Try to disable it (define BOOST_TEST_NO_LIB) and name library explicetly.
Also, I tried to debug UTF example 02 and 03 when they dumped memory leaks and I revealed that there are exceptions thrown in lines supposed to be catched by Boost Test Framework:
Boost.Test detects that you are running under debugger and don't try to catch level system errors, so that you could see message from debugger and analize stack.
Huh! That's the end of my long story :) I'd be very thankful for any help how to solve this problem, especially with "original" UTF library created by bjam. How to make it working?
I will try it myself tommorow.
Please, be placable as I'm a Boost.Test newbie. I searched through Boost.Test docs and lists archives but I still can not solve my problem.
Don't rely on docs yet. I am working on an update.
Thanks in advance for your help Cheers -- Mateusz Loskot http://mateusz.loskot.net
Gennadiy
Hi Gennadiy, Gennadiy Rozental wrote:
"Mateusz Loskot"
wrote in message news:44064B20.4050504@loskot.net... [...] There is only one thing I can't explain why I had not to add library (e.g. libboost_unit_test_framework-vc80-mt-1_34.lib) to link with. VC++ did not complain about missing libraries or unresolved symbols. OK, magic :-)
This is an autolinking in use. Get the latest docs from cvs and read compilation instruction for UTF. There is section there covering it now.
Autolinking - yes, I suppose something like thig but I was not able to explain it for myself. I have read docs on the website and they seem out of date. So, now I'm going to read the updated version from CVS.
Then, I tried to run rest of examples, unit_test_example_02.cpp and unit_test_example_03.cpp, as explained above. And here comes my problems I noticed with unit_test_example_02 and unit_test_example_03. When I try to run compiled example from unit_test_example_02.cpp I get memory leaks detected:
[...] // problem decription skipped.
I couldn't explain what you are expiriencing. Just one suggestion: make sure you link with proper library. Autolinking inforce proper name. Try to disable it (define BOOST_TEST_NO_LIB) and name library explicetly.
I'll check it today.
Also, I tried to debug UTF example 02 and 03 when they dumped memory leaks and I revealed that there are exceptions thrown in lines supposed to be catched by Boost Test Framework:
Boost.Test detects that you are running under debugger and don't try to catch level system errors, so that you could see message from debugger and analize stack.
Yes, but first I tried to run example 02 and 03 not under debugger, just executing exe files. When I started to get memory leaks dump then I decided to debug it - as I read in list archives this recommendation.
Huh! That's the end of my long story :) I'd be very thankful for any help how to solve this problem, especially with "original" UTF library created by bjam. How to make it working?
I will try it myself tommorow.
Thank you very much. Siply, the problem is that UTF library build by bjam behaves differently from the one build with VC++ project file. I'll also test it without autolinking.
Please, be placable as I'm a Boost.Test newbie. I searched through Boost.Test docs and lists archives but I still can not solve my problem.
Don't rely on docs yet. I am working on an update.
Now I know that ;-) Cheers -- Mateusz Łoskot http://mateusz.loskot.net
Hi Gennadiy, Gennadiy Rozental wrote:
"Mateusz Loskot"
wrote in message news:44064B20.4050504@loskot.net... Then, I tried to run rest of examples, unit_test_example_02.cpp and unit_test_example_03.cpp, as explained above. And here comes my problems I noticed with unit_test_example_02 and unit_test_example_03. When I try to run compiled example from unit_test_example_02.cpp I get memory leaks detected: [...]
I couldn't explain what you are expiriencing. Just one suggestion: make sure you link with proper library. Autolinking inforce proper name. Try to disable it (define BOOST_TEST_NO_LIB) and name library explicetly.
I tested with autolinking disabled and I tried to use libboost_unit_test_framework-vc80-mt-*.lib libraries explicitly. I still get the same memory leaks dump. The only difference is that when I use UTF library built in debug mode (-gd) I get more info (here I test UTF example 03): D:\temp\utf_test>debug\utf_test.exe Running 2 test cases... ./utf_test.cpp(11): error in "force_division_by_zero": check false failed Detected memory leaks! ... ... here memory dump but when I use UTF library built in non-debug mode I get only: D:\temp\utf_test>debug\utf_test.exe Running 2 test cases... In both cases I get Windows dialog box with information about crash. I also rebuilt UTF library using -d2 bjam option and I compared compiler options used by bjam with options I use to build examples in VC++ 8.0. In both cases I use same options, double checked. Do you have any idea where may be the problem that I get this memory dump when I use UTF lib built with bjam? When I build UTF library with VC++ 8.0 project everything works well. Simply, UTF seems to not to catch bugs in test examples properly. Here, in example 03, I checked where debuger stops when I push Debug button in the crash dialog box: // reports 'unknown location(0): fatal error in "force_division_by_zero": integer divide by zero' i = i / j; // <------ HERE DEBUGER STOPS but it should be handled by UTF as described in comments above, shouldn't it? Thanks for any help Cheers -- Mateusz Łoskot http://mateusz.loskot.net
Hi, I have one more comment. I dumpled bjam output to file and I noticed there are some errors in the log. All those errors are related to manifest. Here are lines with errors I cutted from bjam output log file: bin\boost\libs\test\build\boost_prg_exec_monitor.dll\vc-8_0\debug\runtime-link-static\threading-multi\boost_prg_exec_monitor-vc80-mt-sgd-1_34.dll.manifest : general error c1010070: Failed to load and parse the manifest. The system cannot find the file specified. bin\boost\libs\test\build\boost_prg_exec_monitor.dll\vc-8_0\release\runtime-link-static\threading-multi\boost_prg_exec_monitor-vc80-mt-s-1_34.dll.manifest : general error c1010070: Failed to load and parse the manifest. The system cannot find the file specified. bin\boost\libs\test\build\boost_unit_test_framework.dll\vc-8_0\debug\runtime-link-static\threading-multi\boost_unit_test_framework-vc80-mt-sgd-1_34.dll.manifest : general error c1010070: Failed to load and parse the manifest. The system cannot find the file specified. bin\boost\libs\test\build\boost_unit_test_framework.dll\vc-8_0\release\runtime-link-static\threading-multi\boost_unit_test_framework-vc80-mt-s-1_34.dll.manifest : general error c1010070: Failed to load and parse the manifest. The system cannot find the file specified. Cheers -- Mateusz Łoskot http://mateusz.loskot.net
"Mateusz Loskot"
Hi,
I have one more comment. I dumpled bjam output to file and I noticed there are some errors in the log. All those errors are related to manifest.
Here are lines with errors I cutted from bjam output log file:
bin\boost\libs\test\build\boost_prg_exec_monitor.dll\vc-8_0\debug\runtime-link-static\threading-multi\boost_prg_exec_monitor-vc80-mt-sgd-1_34.dll.manifest : general error c1010070: Failed to load and parse the manifest. The system cannot find the file specified.
bin\boost\libs\test\build\boost_prg_exec_monitor.dll\vc-8_0\release\runtime-link-static\threading-multi\boost_prg_exec_monitor-vc80-mt-s-1_34.dll.manifest : general error c1010070: Failed to load and parse the manifest. The system cannot find the file specified.
bin\boost\libs\test\build\boost_unit_test_framework.dll\vc-8_0\debug\runtime-link-static\threading-multi\boost_unit_test_framework-vc80-mt-sgd-1_34.dll.manifest : general error c1010070: Failed to load and parse the manifest. The system cannot find the file specified.
bin\boost\libs\test\build\boost_unit_test_framework.dll\vc-8_0\release\runtime-link-static\threading-multi\boost_unit_test_framework-vc80-mt-s-1_34.dll.manifest : general error c1010070: Failed to load and parse the manifest. The system cannot find the file specified.
I will have to look into this. Does anyone familiar with Boost.Build have any comments? Gennadiy
I figured it out last night. I will have to bring it up with Boost.Build guys. Essentially difference is in /EH option. bjam build with /EHsc while project use /EHa. Thank you for bringing it up. Gennadiy
Gennadiy Rozental wrote:
I figured it out last night. I will have to bring it up with Boost.Build guys.
Thank you very much!
Essentially difference is in /EH option. bjam build with /EHsc while project use /EHa.
It seems I missed it. But today I created VC++ 8.0 project from scratch and I'm sure I set /EHsc according to bjam output. Saddly, it didn't help much. Cheers -- Mateusz Łoskot http://mateusz.loskot.net
Hi. First of all I want to thank the previous answers
for my mails. They were very helpfull
But I still have problems using serialization. In
particular, I cant seem to find the correct way to
register a subclass with its base class so that
serliaziig through a pointer works fine.
I dont know exactly where to place the
BOOST_CLASS_EXPORT macros. I put them in the cpp file
where all the hierarchy classes are defined, but this
arises the following problem (for example):
boost::serialization::void_cast_detail::void_cast_primitive
participants (3)
-
Federico Feller
-
Gennadiy Rozental
-
Mateusz Łoskot