Hi All, I have a BOOST test case as below BOOST_AUTO_TEST_CASE( BoostUnitTestSample ) { // seven ways to detect and report the same error: BOOST_CHECK( add( 2,2 ) == 4 ); // #1 continues on error BOOST_REQUIRE( add( 2,2 ) == 4 ); // #2 throws on error somefunction_whichleaksmemory();----------->memory leak function. if( add( 2,2 ) != 4 ) BOOST_ERROR( "Ouch..." ); // #3 continues on error } I want to programmatically detect the memory leak in function somefunction_whichleaks() and get information like line number and filename where the leaked occurred. And most importantly I should know in which test case this leaked occured.May be I would like to have a dump of all this information in some file. Does anybody knows a solution to this?
Shailesh H
Posts
-
Detecting memory leaks in BOOST test cases. -
Call stack trace using BOOSTHello, We are running a boost unit test using command line (cmd). The command is: C:\> /c "D:\MyExecutable.exe" --run_test=testcase1,testcase2,testcase3, --report_format=xml --report_level=detailed --log_format=xml --log_level=all >test_log.xml 2>test_report.xml The output format is in XML. I would like to have the call stack for the failed test cases. Is it possible to write the call stack trace in test_report.xml or test_log.xml ? Is there any macro or Boost API can help me achieve this?
-
how do I group test cases using BOOSTHello, I have observed that in native unit test framework(c++), there is an option to group test cases using attributes which are reflected as traits in the Test Explorer window in MS VS2012. Following is a an example of the same: BEGIN_TEST_METHOD_ATTRIBUTE(TestMethod3) TEST_OWNER(L"SuperMan") TEST_PRIORITY(2) TEST_METHOD_ATTRIBUTE(L"Category",L"Slow") END_TEST_METHOD_ATTRIBUTE() TEST_METHOD(TestMethod3) { Assert::AreEqual(2,6); } How can this be achieved via Boost Unit Test Library? Are there macros to achieve the same?
-
converting to different pixel formats.How do I change the pixel format of any input image to any other pixel format for eg convert to grayscale , true color RGB , paletted(8bpp) , grayscale with alpha , true color with alpha(RGA32). Any C#.Net solution for the above? Regards, Shailesh H :)
-
Varying sliding window size(deflate ratio)I have written a C#.Net application to convert any image into png image. I have basically used the call Image.Save(outputFilename, ImageFormat.Png); I get the proper png file compressed to smaller size and working fine. But my customer wants the application to allow users to modify/vary the sliding window size(deflate ratio) of the compressed png image. So I want to know if whether I can actually supply the deflate ratio to the .Net Framework and the framework compresses the image to a png file with that deflate ratio(sliding window size). Anybody can give suggestions/inputs?
-
Removing ancillary chunksI have a requirement , and that is I want to generate a png file without any "ancillary chunks" (like cHRM , sRGB etc) using C#.Net. How do i do it? any suggestions? Thanks & Regards.
-
Modifying the Image PaletteI have a Format8bppIndexed image . I tried to modify the palette using the below code. ColorPalette pal = bitmapImage.Palette; for (int i = 0; i < pal.Entries.Length/2; i++) pal.Entries[i] = Color.FromArgb(255, 255, 255); bitmapImage.Palette = pal; but the somehow this change in palette does not affect on the image when i save the Image using bitmapImage.Save("filepath"); How do I make the change in palette affect the image.
-
Deleting the Palette Chunk from png streamI have created a .png file from say a bmp using the Image.Save() call. Now I want to delete the PLTE chunk from the .png file created , how do I do it?? Best Regards
-
Deleting the Palette Chunk from png streamYes right ... Deleting palette chunk will make the PNG invalid i know that .. but thats the requirement. You said that the deleting palette chunk is easy. How do i implement that in C#.Net?? Kindly reply.
-
Deleting the Palette Chunk from png streamI am working on a Png encoder software . This software has a requirement that it should generate a png file without the PLTE(palette) chunk , so I want to programmatically delete the "palette chunk" using C#.Net. Anybody out here knows how it can be done using the dotnet framework?
-
Let's Imagining ...I'd like to own a few hundred Kms of land , a big Mansion , a private Jet , few snow clad mountains in my backyard , a flowing river , a ferrari , may be a private space shuttle so that i can land on the moon whenever i want , a pet elephant (I like that animal) and a world tour package freeeeee !!. Well so much for now... before the Genie dissapears!!
-
Let's Imagining ...I'd like to own a few hundred Kms of land , a big Mansion , a private Jet , few snow clad mountains in my backyard , a flowing river , a ferrari , may be a private space shuttle so that i can land on the moon whenever i want :) , a pet elephant (I like that animal) and a world tour package freeeeee !!. Well so much for now... before the Genie dissapears!! :-D
-
Let's Imagining ...If you were given a choice to get whatever you want in life than what would you like to have in life? ... Or Imagine one fine night in the middle of the night you are woken up by a Jini! and he ask you what you want in life...and then you Imagine.....You can Imagine just anything!
-
Web Development and Software Development BusinessWell I am no Business guy but, I think you should find out what people need .. like what problem people face using internet or software or mobiles or watever and then find a solution to that problem. Develop a gud solution a gud product and then concentrate on marketing ur gud work... and then hope that it clicks!.. take care :)
-
Stack corruption - STRANGE PROBLEM!!Pls note that the above problem is seen only in the Release mode
-
Stack corruption - STRANGE PROBLEM!!I am launching a worker thread . Inside the thread function i open CDialog's using DoModal().There is no problem in the first launch of the thread. But in second launch the stack seems to get corrupted, the CString member variable of the Dialogs show values like "C4".. "D5" etc before even they r initialized in the Dialogs contructor(i.e when the execution is within the constructor).Even after Initializing the dialog's CString variables in constructor the variables do not get initialized, they still show "C4" etc psuedo code below: line 1:CWelcomeDlg dlg; line 2:dlg.SetTitle(strDialogTitle);//Set the dialog Title line 3 :ret = dlg.DoModal();//show dialog //Constructor CWelcomeDlg::CWelcomeDlg(CWnd* pParent /*=NULL*/) : CDialog(CWelcomeDlg::IDD, pParent) { m_strData1=_T("");---->m_strData1 shows value "C4" and cannot b initialized to empty string. m_strData2=_T("");--->m_strData1 shows value "C4" m_strData3=_T("");--->m_strData1 shows value "C4" }