[Scummvm-cvs-logs] SF.net SVN: scummvm:[51391] tools/branches/gsoc2010-decompiler/decompiler/ test

pidgeot at users.sourceforge.net pidgeot at users.sourceforge.net
Tue Jul 27 22:40:24 CEST 2010


Revision: 51391
          http://scummvm.svn.sourceforge.net/scummvm/?rev=51391&view=rev
Author:   pidgeot
Date:     2010-07-27 20:40:23 +0000 (Tue, 27 Jul 2010)

Log Message:
-----------
Add test for incorrect else detection

Modified Paths:
--------------
    tools/branches/gsoc2010-decompiler/decompiler/test/cfg_test.h

Added Paths:
-----------
    tools/branches/gsoc2010-decompiler/decompiler/test/if-no-else.dmp
    tools/branches/gsoc2010-decompiler/decompiler/test/if-no-else.txt

Modified: tools/branches/gsoc2010-decompiler/decompiler/test/cfg_test.h
===================================================================
--- tools/branches/gsoc2010-decompiler/decompiler/test/cfg_test.h	2010-07-27 20:34:35 UTC (rev 51390)
+++ tools/branches/gsoc2010-decompiler/decompiler/test/cfg_test.h	2010-07-27 20:40:23 UTC (rev 51391)
@@ -359,6 +359,23 @@
 				TS_ASSERT(gr->_type == kIfCond);
 		}
 		delete c;
+
+		d = engine->getDisassembler();
+		d->open("decompiler/test/if-no-else.dmp");
+		insts = d->disassemble();
+		delete d;
+		c = new ControlFlow(insts, engine);
+		c->createGroups();
+		g = c->analyze();
+		range = boost::vertices(g);
+		for (VertexIterator it = range.first; it != range.second; ++it) {
+			GroupPtr gr = GET(*it);
+			if (gr->_start->_address == 0x0)
+				TS_ASSERT(gr->_type == kIfCond);
+			TS_ASSERT(!gr->_startElse);
+		}
+
+		delete c;
 		delete engine;
 	}
 

Added: tools/branches/gsoc2010-decompiler/decompiler/test/if-no-else.dmp
===================================================================
(Binary files differ)


Property changes on: tools/branches/gsoc2010-decompiler/decompiler/test/if-no-else.dmp
___________________________________________________________________
Added: svn:mime-type
   + application/octet-stream

Added: tools/branches/gsoc2010-decompiler/decompiler/test/if-no-else.txt
===================================================================
--- tools/branches/gsoc2010-decompiler/decompiler/test/if-no-else.txt	                        (rev 0)
+++ tools/branches/gsoc2010-decompiler/decompiler/test/if-no-else.txt	2010-07-27 20:40:23 UTC (rev 51391)
@@ -0,0 +1,9 @@
+pushWord 42
+pushWordVar 123
+eq
+jumpTrue postIf
+wordVarDec 123
+jump postIf
+postIf:
+wordVarDec 123
+stopObjectCodeA


Property changes on: tools/branches/gsoc2010-decompiler/decompiler/test/if-no-else.txt
___________________________________________________________________
Added: svn:mime-type
   + text/plain
Added: svn:eol-style
   + native


This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.




More information about the Scummvm-git-logs mailing list