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 269431 - how to achieve total MCDC in Cunit testing framework
Summary: how to achieve total MCDC in Cunit testing framework
Status: RESOLVED INVALID
Alias: None
Product: cnd
Classification: Unclassified
Component: UnitTest Support (show other bugs)
Version: 8.2
Hardware: PC Windows 7 x64
: P3 normal (vote)
Assignee: ilia
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2016-12-26 13:37 UTC by PawanK
Modified: 2017-04-03 08:15 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 PawanK 2016-12-26 13:37:24 UTC

    
Comment 1 PawanK 2016-12-26 14:18:54 UTC
I am unable to unit test a simple function such as 

void function(void)
{
	int a = 10;
	int b = 20;
	int c;

	c = a + b;
}

where 'c' is function scope variable.
how to check the value of 'c' using ASSERTS.
Comment 2 ilia 2017-04-03 08:15:43 UTC
You can use CppUnit framework as follows:
CPPUNIT_ASSERT_EQUAL(30, c)

Please use forums to get help with code.