diff options
author | Alon Zakai <alonzakai@gmail.com> | 2011-03-21 19:50:03 -0700 |
---|---|---|
committer | Alon Zakai <alonzakai@gmail.com> | 2011-03-21 19:50:03 -0700 |
commit | b956a15fb40aa661c7feb0f8b078f1bb0ea1d622 (patch) | |
tree | 6b8a457060fd2765232d0d3705fde59f674383cc /tests | |
parent | 24856d20699818b35f01963e4144c87d1a5c56ff (diff) |
poppler-related tweaks
Diffstat (limited to 'tests')
-rw-r--r-- | tests/poppler/poppler/Array.cc | 4 | ||||
-rw-r--r-- | tests/poppler/poppler/Dict.cc | 5 | ||||
-rw-r--r-- | tests/poppler/poppler/Object.h | 3 | ||||
-rw-r--r-- | tests/poppler/readme.txt | 5 | ||||
-rw-r--r-- | tests/runner.py | 36 |
5 files changed, 46 insertions, 7 deletions
diff --git a/tests/poppler/poppler/Array.cc b/tests/poppler/poppler/Array.cc index e7ec4e7d..4c09b034 100644 --- a/tests/poppler/poppler/Array.cc +++ b/tests/poppler/poppler/Array.cc @@ -59,6 +59,10 @@ void Array::add(Object *elem) { size *= 2; } elems = (Object *)greallocn(elems, size, sizeof(Object)); + // XXX Emscripten: Initialize the entries, to prevent undefined values + for (int i=length; i<size; i++) { + elems[i].zeroUnion(); + } } elems[length] = *elem; ++length; diff --git a/tests/poppler/poppler/Dict.cc b/tests/poppler/poppler/Dict.cc index 1428113b..548508c8 100644 --- a/tests/poppler/poppler/Dict.cc +++ b/tests/poppler/poppler/Dict.cc @@ -84,6 +84,7 @@ Dict::Dict(Dict* dictA) { entries = (DictEntry *)gmallocn(size, sizeof(DictEntry)); for (int i=0; i<length; i++) { entries[i].key = strdup(dictA->entries[i].key); + entries[i].val.zeroUnion(); // XXX Emscripten dictA->entries[i].val.copy(&entries[i].val); } } @@ -112,6 +113,10 @@ void Dict::add(char *key, Object *val) { size *= 2; } entries = (DictEntry *)greallocn(entries, size, sizeof(DictEntry)); + // XXX Emscripten: Initialize the entries, to prevent undefined values + for (int i=length; i<size; i++) { + entries[i].val.zeroUnion(); + } } entries[length].key = key; entries[length].val = *val; diff --git a/tests/poppler/poppler/Object.h b/tests/poppler/poppler/Object.h index 72ff6678..fc61a019 100644 --- a/tests/poppler/poppler/Object.h +++ b/tests/poppler/poppler/Object.h @@ -111,7 +111,8 @@ enum ObjType { class Object { public: // clear the anonymous union as best we can -- clear at least a pointer - void zeroUnion() { this->name = NULL; } + // XXX Emscripten: Also null out ref.gen + void zeroUnion() { this->name = NULL; this->ref.gen = 0; } // Default constructor. Object(): diff --git a/tests/poppler/readme.txt b/tests/poppler/readme.txt new file mode 100644 index 00000000..e965f0d9 --- /dev/null +++ b/tests/poppler/readme.txt @@ -0,0 +1,5 @@ +This is Poppler. See README and COPYING. + +Changes for Emscripten: + Object.h, Array.cc, Dict.cc are modified to avoid uninitialization errors (search for 'Emscripten') + diff --git a/tests/runner.py b/tests/runner.py index fba28828..d80560bb 100644 --- a/tests/runner.py +++ b/tests/runner.py @@ -1633,7 +1633,9 @@ if 'benchmark' not in sys.argv: def test_freetype(self): if LLVM_OPTS or COMPILER == CLANG: global RELOOP; RELOOP = 0 # Too slow; we do care about typed arrays and OPTIMIZE though - global CORRECT_SIGNS; CORRECT_SIGNS = 1 # Not sure why, but needed + + global CORRECT_SIGNS + if CORRECT_SIGNS == 0: CORRECT_SIGNS = 1 # Not sure why, but needed def post(filename): # Embed the font into the document @@ -1678,11 +1680,33 @@ if 'benchmark' not in sys.argv: if COMPILER != LLVM_GCC: return # llvm-link failure when using clang, LLVM bug 9498 if RELOOP or LLVM_OPTS: return # TODO + global USE_TYPED_ARRAYS; USE_TYPED_ARRAYS = 0 # XXX bug - we fail with this FIXME + global SAFE_HEAP; SAFE_HEAP = 0 # Has variable object - global CORRECT_SIGNS; CORRECT_SIGNS = 1 # isdigit does -ord('0') and then <= 9, assuming unsigned - global CORRECT_OVERFLOWS; CORRECT_OVERFLOWS = 1 - global COMPILER_TEST_OPTS; COMPILER_TEST_OPTS = ['-I' + path_from_root('tests', 'libcxx', 'include')] # Avoid libstdc++ linking issue, see libcxx test + #global CORRECT_OVERFLOWS; CORRECT_OVERFLOWS = 1 + + #global CHECK_OVERFLOWS; CHECK_OVERFLOWS = 1 + #global CHECK_SIGNS; CHECK_SIGNS = 1 + + global CORRECT_SIGNS; CORRECT_SIGNS = 1 + global CORRECT_SIGNS_LINES + CORRECT_SIGNS_LINES = ['parseargs.cc:171', 'BuiltinFont.cc:64', 'NameToCharCode.cc:115', 'GooHash.cc:368', + 'Stream.h:469', 'PDFDoc.cc:1064', 'Lexer.cc:201', 'Splash.cc:1130', 'XRef.cc:997', + 'vector:714', 'Lexer.cc:259', 'Splash.cc:438', 'Splash.cc:532', 'GfxFont.cc:1152', + 'Gfx.cc:3838', 'Splash.cc:3162', 'Splash.cc:3163', 'Splash.cc:3164', 'Splash.cc:3153', + 'Splash.cc:3159', 'SplashBitmap.cc:80', 'SplashBitmap.cc:81', 'SplashBitmap.cc:82', + 'Splash.cc:809', 'Splash.cc:805', 'GooHash.cc:379', + # FreeType + 't1load.c:1850', 'psconv.c:104', 'psconv.c:185', 'psconv.c:366', 'psconv.c:399', + 'ftcalc.c:308', 't1parse.c:405', 'psconv.c:431', 'ftcalc.c:555', 't1objs.c:458', + 't1decode.c:595', 't1decode.c:606', 'pstables.h:4048', 'pstables.h:4055', 'pstables.h:4066', + 'pshglob.c:166', 'ftobjs.c:2548', 'ftgrays.c:1190', 'psmodule.c:116', 'psmodule.c:119', + 'psobjs.c:195', 'pshglob.c:165', 'ttload.c:694', 'ttmtx.c:195', 'sfobjs.c:957', + 'sfobjs.c:958', 'ftstream.c:369', 'ftstream.c:372', 'ttobjs.c:1007'] # And many more... + + global COMPILER_TEST_OPTS; COMPILER_TEST_OPTS = ['-I' + path_from_root('tests', 'libcxx', 'include'), # Avoid libstdc++ linking issue, see libcxx test + '-g'] global INVOKE_RUN; INVOKE_RUN = 0 # We append code that does run() ourselves @@ -1696,9 +1720,9 @@ if 'benchmark' not in sys.argv: src = open(filename, 'a') src.write( ''' - this._STDIO.prepare('paper.pdf', eval(read('paper.pdf.js'))); + _STDIO.prepare('paper.pdf', eval(read('paper.pdf.js'))); run(args); - print("Data: " + JSON.stringify(this._STDIO.streams[this._STDIO.filenames['*s-0*d.']].data)); // work around __formatString__ fail + print("Data: " + JSON.stringify(_STDIO.streams[_STDIO.filenames['*s-0*d.']].data)); // work around __formatString__ fail ''' ) src.close() |