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 186444 - CppUnitTest generates wrong code
Summary: CppUnitTest generates wrong code
Status: VERIFIED FIXED
Alias: None
Product: cnd
Classification: Unclassified
Component: Project (show other bugs)
Version: 6.x
Hardware: PC All
: P1 normal (vote)
Assignee: nnnnnk
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-05-20 15:48 UTC by dnikitin
Modified: 2010-05-25 12:17 UTC (History)
1 user (show)

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description dnikitin 2010-05-20 15:48:22 UTC
Product Version: NetBeans IDE Dev (Build 201005191833)
Java: 1.6.0_16; Java HotSpot(TM) Client VM 14.2-b01
System: Linux version 2.6.28-18-generic running on i386; UTF-8; en_US (nb)
----------------------------------------------------------

-- create Quote project
-- open cpu.cpp
-- click on Cpu::GetType() and right-click
-- select Create Test --> New CppUnit Test ...

==> Some  cppunit files were generated
-- open newclasstest.cpp from Test Files folder

You can see the following code:

void testGetCategory() {
    Cpu cpu;
    const char* result = cpu.GetCategory();
    if(true /*check result*/) {
        CPPUNIT_ASSERT(false);    }
}

but should be

void newtestclass::testGetCategory() {
    Cpu cpu;
    const char* result = cpu.GetCategory();
    if(true /*check result*/) {
        CPPUNIT_ASSERT(false);  
    }
}
Comment 1 nnnnnk 2010-05-20 16:26:57 UTC
Fix:
http://hg.netbeans.org/cnd-main/rev/c9b856c8c2bc
Comment 2 nnnnnk 2010-05-20 16:32:53 UTC
I think it's a showstopper.
Comment 3 Leonid Lenyashin 2010-05-20 18:32:38 UTC
What does QA think?
Comment 4 Alexander Pepin 2010-05-21 14:00:17 UTC
After discussion the bug was accepted as a showstopper as it's a highly visible defect in the new target feature.
Comment 5 Alexander Pepin 2010-05-24 12:39:56 UTC
please review the fix
Comment 6 Alexey Vladykin 2010-05-24 12:54:33 UTC
I've reviewed the fix. It is correct and safe.
Comment 7 dnikitin 2010-05-24 13:04:41 UTC
verified in rc1 with new org-netbeans-modules-cnd-cncppunit.jar
Comment 8 Alexey Vladykin 2010-05-24 13:41:16 UTC
The fix has been transplanted to release69:
http://hg.netbeans.org/release69/rev/3cd399457ad7
Comment 9 soldatov 2010-05-25 12:17:30 UTC
verified in RC1