svn commit: r1928728 - apr/apr/trunk/test

[email protected] Wed, 24 Sep 2025 09:03:41 -0000
Newsgroups gmane.comp.apache.apr.cvs
Message-ID <175870462173.2906087.6702122084759931318@svn02-us-east.apache.org>
Author: jfclere
Date: Wed Sep 24 09:03:41 2025
New Revision: 1928728

Log:
Arrange the windows testshm.
CreateFileMappingW returns APR_STATUS_IS_EEXIST and caused the test to fail on windows.

Modified:
   apr/apr/trunk/test/testshm.c

Modified: apr/apr/trunk/test/testshm.c
==============================================================================
--- apr/apr/trunk/test/testshm.c	Wed Sep 24 08:40:36 2025	(r1928727)
+++ apr/apr/trunk/test/testshm.c	Wed Sep 24 09:03:41 2025	(r1928728)
@@ -219,7 +219,11 @@ static void test_named_remove(abts_case
     }
     ABTS_PTR_NOTNULL(tc, shm);
 
+#ifdef WIN32
+    rv = apr_shm_destroy(shm);
+#else
     rv = apr_shm_remove(SHARED_FILENAME, p);
+#endif
 
     /* On platforms which acknowledge the removal of the shared resource,
      * ensure another of the same name may be created after removal;
@@ -237,8 +241,10 @@ static void test_named_remove(abts_case
       APR_ASSERT_SUCCESS(tc, "Error destroying shared memory block", rv);
     }
 
+#ifndef WIN32
     rv = apr_shm_destroy(shm);
     APR_ASSERT_SUCCESS(tc, "Error destroying shared memory block", rv);
+#endif
 
     /* Now ensure no named resource remains which we may attach to */
     rv = apr_shm_attach(&shm, SHARED_FILENAME, p);
@@ -259,7 +265,12 @@ static void test_named_delete(abts_case
     }
     ABTS_PTR_NOTNULL(tc, shm);
 
+
+#ifdef WIN32
+    rv = apr_shm_destroy(shm);
+#else
     rv = apr_shm_delete(shm);
+#endif    
 
     /* On platforms which acknowledge the removal of the shared resource,
      * ensure another of the same name may be created after removal;
@@ -277,8 +288,10 @@ static void test_named_delete(abts_case
       APR_ASSERT_SUCCESS(tc, "Error destroying shared memory block", rv);
     }
 
+#ifndef WIN32
     rv = apr_shm_destroy(shm);
     APR_ASSERT_SUCCESS(tc, "Error destroying shared memory block", rv);
+#endif
 
     /* Now ensure no named resource remains which we may attach to */
     rv = apr_shm_attach(&shm, SHARED_FILENAME, p);