fortrangoingonforty/fortsh / 885a152

Browse files

Fix test_memory_pool for pointer-based string_ref

Update allocated() to associated() since string_ref%data is now
a pointer instead of allocatable array.
Authored by mfwolffe <wolffemf@dukes.jmu.edu>
SHA
885a152fdba28c38e7761ddacd0c5cd1fbf8a880
Parents
89891d8
Tree
2b1061d

1 changed file

StatusFile+-
M tests/test_memory_pool.f90 2 2
tests/test_memory_pool.f90modified
@@ -22,7 +22,7 @@ program test_memory_pool
22
   call pool_init()
22
   call pool_init()
23
   ref1 = pool_get_string(100)
23
   ref1 = pool_get_string(100)
24
 
24
 
25
-  if (.not. allocated(ref1%data)) then
25
+  if (.not. associated(ref1%data)) then
26
     print *, "  FAILED: String not allocated"
26
     print *, "  FAILED: String not allocated"
27
     all_tests_passed = .false.
27
     all_tests_passed = .false.
28
   else
28
   else
@@ -108,7 +108,7 @@ program test_memory_pool
108
   print *, "Test 6: Large allocation fallback..."
108
   print *, "Test 6: Large allocation fallback..."
109
   ref1 = pool_get_string(100000)  ! 100KB - should bypass pool
109
   ref1 = pool_get_string(100000)  ! 100KB - should bypass pool
110
 
110
 
111
-  if (.not. allocated(ref1%data)) then
111
+  if (.not. associated(ref1%data)) then
112
     print *, "  FAILED: Large allocation failed"
112
     print *, "  FAILED: Large allocation failed"
113
     all_tests_passed = .false.
113
     all_tests_passed = .false.
114
   else
114
   else