[mapguide-commits] r9780 - in sandbox/jng/vanilla_swig/Bindings: . src/Test/DotNet/src/TestMapGuideApi/ExternalTests src/Test/DotNet/src/TestRunner

svn_mapguide at osgeo.org svn_mapguide at osgeo.org
Sat Nov 14 01:26:34 PST 2020


Author: jng
Date: 2020-11-14 01:26:33 -0800 (Sat, 14 Nov 2020)
New Revision: 9780

Modified:
   sandbox/jng/vanilla_swig/Bindings/TODO.txt
   sandbox/jng/vanilla_swig/Bindings/src/Test/DotNet/src/TestMapGuideApi/ExternalTests/MapTests.cs
   sandbox/jng/vanilla_swig/Bindings/src/Test/DotNet/src/TestRunner/Program.cs
Log:
Fix one of the failures in the .net test runner. The failing test was exercising the linked tile set restriction which is no longer valid as of MGOS 4.0, so the expected outcome has been inverted (we now expect creating a MgMap against a MDF with a linked tile set to *succeed* now, not fail)

Modified: sandbox/jng/vanilla_swig/Bindings/TODO.txt
===================================================================
--- sandbox/jng/vanilla_swig/Bindings/TODO.txt	2020-11-14 09:01:14 UTC (rev 9779)
+++ sandbox/jng/vanilla_swig/Bindings/TODO.txt	2020-11-14 09:26:33 UTC (rev 9780)
@@ -1,5 +1,6 @@
  - [x] Check that .net error messages are being read (https://github.com/jumpinjackie/mapguide-api-bindings/issues/35)
  - [x] Explore whether our current instability is due to invalid class layout assumptions due to stubbing ACE_Recursive_Thread_Mutex to avoid leaking ACE headers
+ - [ ] Generate XML documentation for our .net wrapper binding projects
  - [ ] Make sure we can build debug bindings
  - [ ] Fix up inconsistent stack direction in C# exceptions (C++ call stack are printed downwards, C# call stack is printed upwards)
  - Split .net binding into the Foundation/Geometry/PlatformBase/MapGuideCommon/Web layout (https://github.com/jumpinjackie/mapguide-api-bindings/issues/18)

Modified: sandbox/jng/vanilla_swig/Bindings/src/Test/DotNet/src/TestMapGuideApi/ExternalTests/MapTests.cs
===================================================================
--- sandbox/jng/vanilla_swig/Bindings/src/Test/DotNet/src/TestMapGuideApi/ExternalTests/MapTests.cs	2020-11-14 09:01:14 UTC (rev 9779)
+++ sandbox/jng/vanilla_swig/Bindings/src/Test/DotNet/src/TestMapGuideApi/ExternalTests/MapTests.cs	2020-11-14 09:26:33 UTC (rev 9780)
@@ -66,19 +66,38 @@
 
                 resSvc.SetResource(resMDF, contentMDF, null);
 
-                //This should throw because making a MgMap from a Map Defintion that links to a XYZ tile set
-                //is not supported
-                MgMapBase map = factory.CreateMap(resMDF);
+                //As of MapGuide RFC 173 (adopted in MGOS 4.0), the tile set restriction has been
+                //removed, meaning this operation should now be allowed
+                MgMap map = factory.CreateMap(resMDF) as MgMap;
+                Assert.IsNotNull(map);
 
-                Assert.Fail("Expected MgUnsupportedTileProviderException to be thrown");
+                //Information in the linked tile set should surface through these new APIs
+                Assert.Equals("XYZ", map.GetTileSetProvider());
+                Assert.Equals("PNG", map.GetTileFormat());
+                Assert.Equals(1, map.GetTilePixelRatio());
             }
             catch (MgException ex) when (ex.GetExceptionCode() == MgExceptionCodes.MgUnsupportedTileProviderException)
             {
-
+                Assert.Fail("Creating a MgMap from a XYZ linked tile set should now be allowed!");
             }
         }
     }
 
+    /*
+    This test case exercises the fix for the following reported issue:
+
+    MgMap fails to initialize properly from linked tile set if both coordinate systems match
+
+        When attempting to view a Map Definition that is linked to a tile set in the AJAX Viewer, 
+        the viewer will fail to load due to a null map extent.
+
+        The reason we have a null map extent is because when we initialize an MgMap? from a Map 
+        Definition that links to a tile set, if both coordinate systems are the same, we are forgetting
+        to set the map/data extents and center members, which results in a null map extent when retrieved.
+
+        The AJAX viewers tries to set up the initial view based on the extent of the map, which given it
+        is null in this case causes the viewer loading to fail.
+     */
     public class TestTicket2538 : ExternalTestBase
     {
         public override void Execute(IPlatformFactory factory, ITestLogger logger)

Modified: sandbox/jng/vanilla_swig/Bindings/src/Test/DotNet/src/TestRunner/Program.cs
===================================================================
--- sandbox/jng/vanilla_swig/Bindings/src/Test/DotNet/src/TestRunner/Program.cs	2020-11-14 09:01:14 UTC (rev 9779)
+++ sandbox/jng/vanilla_swig/Bindings/src/Test/DotNet/src/TestRunner/Program.cs	2020-11-14 09:26:33 UTC (rev 9780)
@@ -75,6 +75,12 @@
                     exitCode = Run(opts);
                 });
 
+            //If you have built the .net SWIG glue wrapper with REFCOUNTING_DIAGNOSTICS, then
+            //you should be seeing a whole bunch of refcounting chatter, which is verification
+            //that we are actually releasing our unmanaged resources 
+            GC.Collect();
+            GC.WaitForPendingFinalizers();
+
             return exitCode;
         }
 



More information about the mapguide-commits mailing list