jaketmp / ePub-quicklook

NOTE: Not working in Mojave and later! ePub quicklook and spotlight plugins for Mac OS X.
BSD 3-Clause "New" or "Revised" License
572 stars 58 forks source link

Very odd problems with tests failing #24

Closed chrisridd closed 12 years ago

chrisridd commented 12 years ago

I can't see what's caused this, but a bunch of tests are failing because the JTPepub objects are "randomly" nil.

I think they're nil because mimetype (inside openEPUBfile) is wrong - NSlogging of mimetype shows:

Mar 2 21:43:03 aluminium otest[23787]: mimetype application/epub+zip Mar 2 21:43:03 aluminium otest[23787]: mimetype application/epub+zip2007/ops Mar 2 21:43:03 aluminium otest[23787]: mimetype application/epub+zipctions Mar 2 21:43:03 aluminium otest[23787]: mimetype (null)

I tried using NULL instead of my mmapped I/O stuff, no change.

Something's up, I think with memory somewhere. I think the init methods for ZipArchive are screwy - self = [self init] for example. Deleting the (useless) init method might help. Also you must call [self release] on failures, not [self dealloc]. The unit tests call setUp and tearDown for every test case, so they do exercise memory quite a bit.

I'm not sure what the best way of debugging memory problems like this is in Xcode...

chrisridd commented 12 years ago

A git bisect session suggests that SHA: 6cbb27712fe1c2fea28a91ca1cf10fd403758679 introduced the problems. Don't see how...

chrisridd commented 12 years ago

Aha! Fixed... (pull request in next issue)

jaketmp commented 12 years ago

Ah, that's annoying, the docs are pretty explicit about having no cr/lf in the mimetype file (from here) - still you have to live in the real world.

The same docs state that the encoding should be bare ASCII, I was getting lucky with UTF-8 / ASCII equivalence before.