aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEugene Sandulenko2016-07-10 14:05:06 +0200
committerEugene Sandulenko2016-08-03 23:40:36 +0200
commit855db111fcfca11224f77255a01bef50eb386961 (patch)
tree2a474d41ba2416abe0f93dc268564db2e1bbb0cd
parentbb7e9b64b6e8eeeff90b5496a465f62f1bd8e705 (diff)
downloadscummvm-rg350-855db111fcfca11224f77255a01bef50eb386961.tar.gz
scummvm-rg350-855db111fcfca11224f77255a01bef50eb386961.tar.bz2
scummvm-rg350-855db111fcfca11224f77255a01bef50eb386961.zip
DIRECTOR: Lingo: Execute test suite
-rw-r--r--engines/director/lingo/lingo.cpp11
-rw-r--r--engines/director/lingo/tests/macros.lingo13
-rw-r--r--engines/director/lingo/tests/macros2.lingo11
3 files changed, 22 insertions, 13 deletions
diff --git a/engines/director/lingo/lingo.cpp b/engines/director/lingo/lingo.cpp
index b9a7488952..dd3d0cde19 100644
--- a/engines/director/lingo/lingo.cpp
+++ b/engines/director/lingo/lingo.cpp
@@ -309,7 +309,18 @@ void Lingo::runTests() {
if (stream) {
uint size = stream->size();
+ char *script = (char *)calloc(size + 1, 1);
+
+ stream->read(script, size);
+
warning("Executing file %s of size %d", m.getName().c_str(), size);
+
+ addCode(script, kMovieScript, counter);
+ executeScript(kMovieScript, counter);
+
+ free(script);
+
+ counter++;
}
inFile.close();
diff --git a/engines/director/lingo/tests/macros.lingo b/engines/director/lingo/tests/macros.lingo
index 9167f1dffb..a75dc4c8f9 100644
--- a/engines/director/lingo/tests/macros.lingo
+++ b/engines/director/lingo/tests/macros.lingo
@@ -40,16 +40,3 @@ end if
put par1
put par2
put par3
-", kMovieScript, 1);
-
-_lingo->addCode("check(2, 3)
-global x, y
-set y = 8
-shipx
-put x
-zipx
-put x
-put y
-check(1, 2, 3)
-check 4, 5, 6
-check 7, 8
diff --git a/engines/director/lingo/tests/macros2.lingo b/engines/director/lingo/tests/macros2.lingo
new file mode 100644
index 0000000000..b587ae421c
--- /dev/null
+++ b/engines/director/lingo/tests/macros2.lingo
@@ -0,0 +1,11 @@
+check(2, 3)
+global x, y
+set y = 8
+shipx
+put x
+zipx
+put x
+put y
+check(1, 2, 3)
+check 4, 5, 6
+check 7, 8