[commit] r2296 - in trunk: GME/Parser Tests/GPyUnit

GMESRC Repository Notifications gme-commit at list.isis.vanderbilt.edu
Tue Aug 20 17:06:02 CDT 2013


Author: ksmyth
Date: Tue Aug 20 17:06:02 2013
New Revision: 2296

Log:
Fix regression: parser ParseProject did not maintain GUIDs

Modified:
   trunk/GME/Parser/MgaParser.cpp
   trunk/Tests/GPyUnit/test_parser.py

Modified: trunk/GME/Parser/MgaParser.cpp
==============================================================================
--- trunk/GME/Parser/MgaParser.cpp	Mon Aug 19 12:56:18 2013	(r2295)
+++ trunk/GME/Parser/MgaParser.cpp	Tue Aug 20 17:06:02 2013	(r2296)
@@ -629,12 +629,12 @@
 		else if( (*i).first == _T("guid") )
 		{
 			RegisterLookup((*i).second, object);
-		}
-		else if( m_maintainGuids && (*i).first == _T("guid"))
-		{
+			if (m_maintainGuids)
+			{
 				// when fco was created already got a fresh GUID, but we need to maintain
 				// the old guid, thus we overwrite the old value with the parsed one
-			COMTHROW(object->PutGuidDisp( CComBSTR( (*i).second.c_str())));
+				COMTHROW(object->PutGuidDisp( CComBSTR( (*i).second.c_str())));
+			}
 		}
 		else if( (*i).first == _T("perm") )
 		{

Modified: trunk/Tests/GPyUnit/test_parser.py
==============================================================================
--- trunk/Tests/GPyUnit/test_parser.py	Mon Aug 19 12:56:18 2013	(r2295)
+++ trunk/Tests/GPyUnit/test_parser.py	Tue Aug 20 17:06:02 2013	(r2296)
@@ -11,7 +11,15 @@
     def test_ParseMetaGME(self):
         mga = GPyUnit.util.parse_xme(self.connstr)
         mga.Save()
-        mga.Close()
+        try:
+            mga.BeginTransactionInNewTerr()
+            try:
+                #self.assertEqual('{5297b5a3-1e47-403c-bf85-40d5c5ecce3f}', mga.RootFolder.GetGuidDisp())
+                self.assertEqual('{819c860f-177a-4382-a325-4c73f616734b}', mga.ObjectByPath('/@Aspects').GetGuidDisp())
+            finally:
+                mga.AbortTransaction()
+        finally:
+            mga.Close()
         if type(self) == TestParser:
             self.assertTrue(os.path.isfile(_adjacent_file("parsertest.mga")))
     


More information about the gme-commit mailing list