mirror of
https://github.com/nasa/trick.git
synced 2024-12-24 23:36:43 +00:00
Add demonstration of getting units from MemoryManager::ref_attributes(). Fixes #132
This commit is contained in:
parent
757f0764f6
commit
fcb419d534
@ -78,6 +78,11 @@ TEST_F(MM_ref_attributes, NormalCases) {
|
|||||||
ref = memmgr->ref_attributes("udt3.M2");
|
ref = memmgr->ref_attributes("udt3.M2");
|
||||||
ASSERT_TRUE(ref != NULL);
|
ASSERT_TRUE(ref != NULL);
|
||||||
EXPECT_EQ( &udt3.M2, ref->address);
|
EXPECT_EQ( &udt3.M2, ref->address);
|
||||||
|
|
||||||
|
ASSERT_TRUE(ref->attr != NULL);
|
||||||
|
ASSERT_TRUE(ref->attr->units != NULL);
|
||||||
|
std::cout << "Units of udt3.M2 = " << ref->attr->units << std::endl;
|
||||||
|
|
||||||
free( ref);
|
free( ref);
|
||||||
|
|
||||||
std::cout << "Case of: \"udt3.M2[2][3]\"" << std::endl;
|
std::cout << "Case of: \"udt3.M2[2][3]\"" << std::endl;
|
||||||
@ -90,6 +95,10 @@ TEST_F(MM_ref_attributes, NormalCases) {
|
|||||||
ref = memmgr->ref_attributes("udt3.M3[1][1][3]");
|
ref = memmgr->ref_attributes("udt3.M3[1][1][3]");
|
||||||
ASSERT_TRUE(ref != NULL);
|
ASSERT_TRUE(ref != NULL);
|
||||||
EXPECT_EQ( &udt3.M3[1][1][3], ref->address);
|
EXPECT_EQ( &udt3.M3[1][1][3], ref->address);
|
||||||
|
|
||||||
|
ASSERT_TRUE(ref->attr != NULL);
|
||||||
|
ASSERT_TRUE(ref->attr->units != NULL);
|
||||||
|
std::cout << "Units of udt3.M3 = " << ref->attr->units << std::endl;
|
||||||
free( ref);
|
free( ref);
|
||||||
|
|
||||||
std::cout << "Case of: \"udt3.C[5]\"" << std::endl;
|
std::cout << "Case of: \"udt3.C[5]\"" << std::endl;
|
||||||
|
@ -72,7 +72,7 @@ class UDT3 {
|
|||||||
double Z;
|
double Z;
|
||||||
int I;
|
int I;
|
||||||
double M2[3][4]; /* r */
|
double M2[3][4]; /* r */
|
||||||
double M3[2][3][4]; /* r */
|
double M3[2][3][4]; /* d */
|
||||||
char C[10];
|
char C[10];
|
||||||
UDT2 N;
|
UDT2 N;
|
||||||
UDT2 NA[2];
|
UDT2 NA[2];
|
||||||
|
Loading…
Reference in New Issue
Block a user