This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

Bug 187370

Summary: On Windows "New C++ Simple Test" and "New CppUnit Test" wizards generates wrong code
Product: cnd Reporter: soldatov <soldatov>
Component: -- Other --Assignee: nnnnnk <nnnnnk>
Status: VERIFIED FIXED    
Severity: normal CC: rbalada
Priority: P2    
Version: 6.x   
Hardware: PC   
OS: Windows XP   
Issue Type: DEFECT Exception Reporter:
Attachments: exception when i am creating CUnit test (trunk only)

Description soldatov 2010-06-09 08:30:47 UTC
On Windows "New C++ Simple Test" and "New CppUnit Test" wizards generates strange code.

Scenario:
- Create Quote
- Open cpu.cc file
- Call context menu and select "Create Test|New C++ Simple Test menu item
- Select all items. Press Next. Press Finish.
- Run tests
==>
g++    -c -g -Wall -I. -MMD -MP -MF build/Debug/Cygwin_4.x-Windows/tests/tests/newsimpletest.o.d -o build/Debug/Cygwin_4.x-Windows/tests/tests/newsimpletest.o tests/newsimpletest.cpp
tests/newsimpletest.cpp:15: error: 'Cpu' has not been declared
tests/newsimpletest.cpp:15: error: expected constructor, destructor, or type conversion before ';' token
tests/newsimpletest.cpp: In function 'void testCpu()':
tests/newsimpletest.cpp:21: error: 'Cpu' was not declared in this scope
tests/newsimpletest.cpp:21: error: expected `;' before 'cpu'
tests/newsimpletest.cpp:18: warning: unused variable 'type'
tests/newsimpletest.cpp:19: warning: unused variable 'architecture'
tests/newsimpletest.cpp:20: warning: unused variable 'units'
tests/newsimpletest.cpp: At global scope:
....
Comment 1 soldatov 2010-06-09 08:35:33 UTC
On Windows instead of #include "cpu.h" IDE adds forward declarations (but it works If file contains functions).

Compiler fails on:
 Cpu::Cpu(int type, int architecture, int units);

const char* Cpu::GetCategory();

const char* Cpu::GetType();
Comment 3 soldatov 2010-06-18 12:00:56 UTC
Created attachment 100202 [details]
exception when i am creating CUnit test (trunk only)
Comment 4 soldatov 2010-06-21 08:19:45 UTC
verified UnitTests on different machines and this problem is fixed
Comment 5 nnnnnk 2010-06-21 10:14:44 UTC
fixed
Comment 6 soldatov 2010-06-21 10:27:15 UTC
verified in trunk.
Comment 7 rbalada 2010-06-21 15:22:52 UTC
(In reply to comment #5)
> fixed

Nick,

please confirm the changeset info missing from your comment #5 should be

http://hg.netbeans.org/cnd-main?cmd=changeset;node=27d1f6fed08e

Thanks,
-R
Comment 9 rbalada 2010-06-22 13:20:31 UTC
main #65c33d1d85c9 transplanted to release691 #cb4a56f90650
main #27d1f6fed08e transplanted to release691 #65613ed4c8ac
Comment 10 soldatov 2010-07-07 14:12:54 UTC
verified in 6.9.1