Test representation class aff::SharedHeap.
This test program gives an example of the usage of the following classes and preprocessor macros:
- See also
- tests/reprtest.cc
#define AFF_REPRTEST_CC_VERSION \
"AFF_REPRTEST_CC V1.3"
using std::cout;
using std::endl;
{
cout << endl
<< s << endl;
const char* p=s;
while (*p) {
cout << "-";
++p;
}
cout << endl;
}
{
#ifdef SENSELESS
#warning intentionally compiling senseless code
#endif
section(
"create a const reference to D");
section(
"const int array should share memory with int array");
CODE(
for (
int i=0; i<N; i++) { A[i]=(i+1)*10; } )
CODE(
for (
int i=0; i<N2; i++) { B[i]=(i+4)*3; } )
CODE(
for (
int i=0; i<N2; i++) { D[i]=(i+2.45)*2; } )
section(
"dump contents - C is filled through B and E is filled through D");
#ifdef ILLEGAL1
section(
"modify C directly - is illegal");
C[9]=354;
#endif
section(
"make B a reference to A");
section(
"modification should be visible through B");
section(
"but C holds the original values");
}