Hello,
In comments there are questions, answer please...Actually I have to pass parameter from the top.
#define test testcase_001 //have to pass parameter, is this right way?
#include "testcases/test.cpp" //could I pass parameterized value here?
class hci_test
{
public:
unsigned char* host_hci_pkt_arr;
unsigned int address;
test test_case; //could I make object handle like this(using parameter here)??
hci_test() //constructor
{
host_hci_pkt_arr = new(nothrow) unsigned char [20];
host_hci_pkt_arr[0] = test_case.host_hci_pkt_arr[0];
host_hci_pkt_arr[1] = test_case.host_hci_pkt_arr[1];
}
};
class hci_test
{
public:
unsigned char* host_hci_pkt_arr;
unsigned int address;
test test_case; //could I make object handle like this(using parameter here)??
hci_test() //constructor
{
host_hci_pkt_arr = new(nothrow) unsigned char [20];
host_hci_pkt_arr[0] = test_case.host_hci_pkt_arr[0];
host_hci_pkt_arr[1] = test_case.host_hci_pkt_arr[1];
}
};
After compilation
compiler throwing errors
:2nd line: error: testcases/test.cpp: No such file or directory
:9th line: error: ISO C++ forbids declaration of ‘testcase_001’ with no type
:9th line: error: ISO C++ forbids declaration of ‘test_case’ with no type
and when I comment first line of code and in 2nd and 9th line, instead of test, I write testcase_001, then it works fine means problem is in passing value from the top.
So let me know the corrections required in it if any or some other way to achieve this kind of passing parameters or values from the top, as #define is just used for aliasing or can do the work like parameter? Please respond
Thanks
cam
cam