diff options
author | schmidt <douglascraigschmidt@users.noreply.github.com> | 1999-11-23 23:08:55 +0000 |
---|---|---|
committer | schmidt <douglascraigschmidt@users.noreply.github.com> | 1999-11-23 23:08:55 +0000 |
commit | 49c13abfb7c2529d9292f4994dc889ef97b311b3 (patch) | |
tree | c58dfc4024c8829dc7bf9e5c2a0104fd333a5c70 /tests | |
parent | e648d4ed83173f0af1bd16af804d1f605586c703 (diff) | |
download | ATCD-49c13abfb7c2529d9292f4994dc889ef97b311b3.tar.gz |
ChangeLogTag:Tue Nov 23 12:47:39 1999 Douglas C. Schmidt <schmidt@tango.cs.wustl.edu>
Diffstat (limited to 'tests')
-rw-r--r-- | tests/Malloc_Test.cpp | 19 | ||||
-rw-r--r-- | tests/Malloc_Test.h | 1 |
2 files changed, 15 insertions, 5 deletions
diff --git a/tests/Malloc_Test.cpp b/tests/Malloc_Test.cpp index ac0c2cc3b01..1d658d160ad 100644 --- a/tests/Malloc_Test.cpp +++ b/tests/Malloc_Test.cpp @@ -63,6 +63,14 @@ myallocator (const void *base_addr = 0) static Test_Data * initialize (MALLOC *allocator) { + double *temp = 0; + ACE_ALLOCATOR_RETURN (temp, + (double *) allocator->malloc (sizeof (double)), + 0); + // Make sure that doubles work! + *temp = 5.0; + allocator->free (temp); + void *ptr; ACE_ALLOCATOR_RETURN (ptr, allocator->malloc (sizeof (Test_Data)), @@ -72,6 +80,7 @@ initialize (MALLOC *allocator) data1->i1_ = 111; data1->i2_ = 222; data1->i3_ = 333; + data1->d1_ = 87.5; void *gap = 0; ACE_ALLOCATOR_RETURN (gap, @@ -79,19 +88,18 @@ initialize (MALLOC *allocator) 0); allocator->free (gap); + ACE_ALLOCATOR_RETURN (ptr, allocator->malloc (sizeof (Test_Data)), 0); Test_Data *data2 = new (ptr) Test_Data; data1->next_ = 0; - data1->i1_ = 111; - data1->i2_ = 222; - data1->i3_ = 333; data2->next_ = data1; data2->i1_ = -111; data2->i2_ = -222; data2->i3_ = -333; + data2->d1_ = 77.34; // Test in shared memory using long (array/pointer) ACE_ALLOCATOR_RETURN (ptr, @@ -144,11 +152,12 @@ print (const char *process_name, for (Test_Data *t = data; t != 0; t = t->next_) { ACE_DEBUG ((LM_DEBUG, - ASYS_TEXT ("<<<< (%P) %s\ni1_ = %d, i2_ = %d, i3_ = %d\n"), + ASYS_TEXT ("<<<< (%P) %s\ni1_ = %d, i2_ = %d, i3_ = %d, d1_ = %f\n"), process_name, t->i1_, t->i2_, - t->i3_)); + t->i3_, + t->d1_)); ACE_DEBUG ((LM_DEBUG, ASYS_TEXT ("*t->bpl_ = %d, t->long_test_->array_[0] = ") ASYS_TEXT ("%d\n>>>>\n"), diff --git a/tests/Malloc_Test.h b/tests/Malloc_Test.h index 8cb99e0c7e0..8fda7368ee4 100644 --- a/tests/Malloc_Test.h +++ b/tests/Malloc_Test.h @@ -36,6 +36,7 @@ struct Test_Data int i1_; int i2_; int i3_; + double d1_; ACE_Based_Pointer<Test_Data> next_; ACE_Based_Pointer<Long_Test> long_test_; }; |