Contributions
Re: Allocation profiling in Visual Studio C++ 2005
And an additional question on allocation profiler. I create some profiling including areas, add objects from loaded modules to them, and I have the same profiling results anytime. In some functions call stacks I get only modules those even wasn't included into checked areas. Moreover, I get the same results even if check no areas though I expected to get nothing. Could anybody explain what is probably wrong?14 years agoPlace AQtime QuestionsAQtime Questions1.8KViews0likes0CommentsRe: Allocation profiling in Visual Studio C++ 2005
Hm, seemed to me that I wasn't too attentive. I created a simple MCF dialog based application right now and added the following code to dialog's OnInitDialog() function: BOOL CAQtimeTestDlg::OnInitDialog() { CDialog::OnInitDialog(); // Set the icon for this dialog. The framework does this automatically // when the application's main window is not a dialog SetIcon(m_hIcon, TRUE); // Set big icon SetIcon(m_hIcon, FALSE); // Set small icon malloc(sizeof(int)); new CButton(); new int; new CMine(); // TODO: Add extra initialization here return TRUE; // return TRUE unless you set the focus to a control } AQtime detected unreleased memory blocks (including my own CMine class) after application has been closed except CButton instance. Does MFC kills it somehow by itself?14 years agoPlace AQtime QuestionsAQtime Questions1.8KViews0likes0CommentsAllocation profiling in Visual Studio C++ 2005
Hello! I test my MFC application in Visual Studio C++ with AQtime 6 for memory leaks using Allocation profiler, and one of the most interesting problems is to detect memory blocks those weren't released manually after application's closing. I can use "Get Results" at any time excluding the moment my code is completed. How can I get results just before garbage collector to free the memory? I thought "Force Garbage Collection" button could help but in my AQtime panel of Visual Studio this button is disabled...14 years agoPlace AQtime QuestionsAQtime Questions12KViews0likes3CommentsRe: Handling exceptions in different units
Hi, Jared! No, it doesn't. According to Windows Script Host reference not full title is acceptable if it begins or ends by this string: http://msdn.microsoft.com/en-us/library/wzcddbek%28VS.85%29.aspx ...and the script really executes the following commands and logs this caption to TC's log but only after human's actions. By the way, returning to handling exceptions in different units... My tests are data-driven and, in general, have the following view: function SCM0025() { Application.Run();// starts the application using "Application" unit function var R; var DataDrivenTest = new CDataDrivenTest("testcase0025.csv"); while (!DataDrivenTest.EOR()) { R = DataDrivenTest.GetRow(); try { // iteration commands called from different units } catch (e) { Log.Error(e.description); } } DataDrivenTest.Finish(); } CDataDrivenTest is my own class that uses DDT object to read CSV-files. Due to we can't handle exceptions in different units by general "try...catch" construction I have to put this one to most functions in other units, for example: // Another unit function DoSomething() { try { // we are doing something here } catch (e) { Application.Terminate(e); } } If an exception occurs Terminate() function from "Application" unit will be called. I close/terminate the application there if it's still alive, and then stop current test execution by Runner.Stop(true) call. It is good to continue project's testing with next test item. But I would execute the failed test with next data rows from CSV-file. Probably, we could add some project's variables to store test's last iteration number. But how could we re-run the failed test again saving project's test items order?1.5KViews0likes0CommentsRe: Handling exceptions in different units
Forgive me for posting here again. But my problem with closing all error messages is still actual. I am using external JS-script proposed higher with little modifications to handle more than one type of window. It works perfect with first type of windows (Visual Studio just-in-time debugger errors) in wndCaptions array but can't handle "Microsoft Visual C++ Runtime Library" windows though I thought it had worked before (I've attached it's screenshot). I determined that the script even couldn't find this window - warning message posts to TC's log only after I press "Ok" button by myself or activate any other application (error window disappears then). I also read that using JS-script is obsolete and Runner.CallObjectMethodAsync() method could be used. But I still can't imagine how to apply this one to all my tests and all methods that could cause unexpected errors. At the moment, I have no ideas of JS-script improvement or anything else... Probably, another external application should be written to attempt handling error windows. P.S. Can you move the topic to another forum? I was inattentive posting this one (didn't see it's only for web testing). var tcObj, wshShell, wndCaptions; wndCaptions = new Array(); wndCaptions.push("Visual Studio"); wndCaptions.push("Microsoft Visual C++"); try { tcObj = GetObject("", "testcomplete.testcompleteapplication"); } catch(e) { tcObj = null; //return; } if (tcObj != null) { wshShell = new ActiveXObject("WScript.Shell"); while (tcObj.Integration.IsRunning()) { for (var i = 0; i < wndCaptions.length; i++) { if (wshShell.AppActivate(wndCaptions)) { /* Registering error window in TC's log */ tcObj.Integration.GetObjectByName("Log").Warning("\"" + wndCaptions + "\" was found in error window's caption"); wshShell.AppActivate(wndCaptions); WScript.Sleep(1000); wshShell.SendKeys("{ENTER}"); } } } }2.2KViews0likes0CommentsRe: Any difference between script execution by TC and similar manual actions?
Hello, Allen. Thanks for your answer. First of all, I followed the second steps offered by you - disabled "Open Applications Support plug-in", and then all red-marked plug-ins excepting "Microsoft Visual C++ Open Application Support". Unfortunately, the bug is reproduced. After that I installed AQTime Demo, followed the steps described higher (to reproduce the problem ran corresponding TC's test) and sent the results via Contact Support form (posting the link to this topic there). Of course, my application has problems and memory leaks but I'm bewildered by the fact that I can't reproduce the problem by hands. Thank you. Dmitriy.1.3KViews0likes0CommentsAny difference between script execution by TC and similar manual actions?
Hello! I'm testing Visual Studio C++ application with TC v7.5 (JScript language is used). It is the multiple document application, and I wrote special scripts to manipulate with documents' windows. To understand how I can close one of these windows I recorded a script clicking close icon (X) on the top right of it. TC generated the code with window object's Close() method. During test run the window closes without clicking close icon (X), and this thing wasn't disturbing me before... But suddenly one of my tests crashed the application on determined window closing. This happens every time I run the test. I tried to repeat it manually...but the application is still alive. I also tried to close the window by Ctrl + F4, and result is the same - application crashes only during automatic test execution. Therefore, I have the following question: is there any difference between automatic and manual test execution (exactly - between calling methods)? I thought they are the same but I have no explanation of behavior described higher at the moment. Thank you for attention.9.4KViews0likes4Comments- 1.2KViews0likes0Comments