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 190885 - created unittest++ project, 'unable to resolve identifiers' error
Summary: created unittest++ project, 'unable to resolve identifiers' error
Status: RESOLVED FIXED
Alias: None
Product: cnd
Classification: Unclassified
Component: Code Model (show other bugs)
Version: 7.0
Hardware: PC Other
: P3 normal (vote)
Assignee: nnnnnk
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-10-10 20:04 UTC by lurscher
Modified: 2010-12-09 18:33 UTC (History)
0 users

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 lurscher 2010-10-10 20:04:36 UTC
tested with build 201010060000

i created a unittest project (c++ application) then, by adding `pkg-config --cflags unittest-cpp` to c++ compiler other options, and `pkg-config --libs unittest-cpp` to linker->option->other option.

I added the following code to main.cpp

#include <UnitTest++.h>
#include <cstdlib>
using namespace std;

int main()
{
    return UnitTest::RunAllTests();
}

TEST(basic) {
    int var;   //<-------Unable to resolve indentifier 'var'
};

TEST(another) {
    CHECK( true );
};

and i get the highlighted error explained in the source comment. The project however builds without problem.

when i remove the second test, the highlighted error dissapears (i'm left just with a warning that var is not being used, which is expected)

the unittest-cpp.pc is the same one attached on a previous bug report:
http://netbeans.org/bugzilla/attachment.cgi?id=102238
Comment 1 nnnnnk 2010-10-15 16:11:38 UTC
Simple example:
#define TEST(name) class Test##name { virtual void RunImpl(); } test##name##Instance; void Test##name::RunImpl()
TEST(basic) {
    int var;
};
TEST(name2) {
    int var2;   //<-------Unable to resolve indentifier 'var'
};

Strange...
It's depends on name.
Error disappears if you delete 'c' in 'basic'.
Comment 2 nnnnnk 2010-10-15 16:25:15 UTC
there are a lot of messages on console:
Reference storage returns CLASS Testbasic[299-310][22:1-22:12] where is expected macro
Reference storage returns CLASS Testname2[330-341][26:1-26:12] where is expected macro