Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add API tests #5

Open
10 tasks
Ortham opened this issue Apr 15, 2016 · 2 comments
Open
10 tasks

Add API tests #5

Ortham opened this issue Apr 15, 2016 · 2 comments

Comments

@Ortham
Copy link
Owner

Ortham commented Apr 15, 2016

I'm not sure if it's worth adding unit tests for the implementation detail, but the API functions should be tested as fully as possible. This will involve having some BSAs to test against: my testing-plugins repository contains a Skyrim BSA that can be used to start with.

I've implemented a barebones set of tests in the add-tests branch. They're currently failing on Linux due to a zlib buffer error (I'm not sure why), but to improve test coverage I need:

  • A TES4 compressed BSA with at least one compressed and one uncompressed file in different folders
  • A TES4 uncompressed BSA with at least one compressed and one uncompressed file in different folders
  • The same combinations as above, but for TES5 BSAs
  • A TES3 BSA with at least two files

I need to then add tests for:

  • Operations on all the TES3, TES4 and TES5 BSAs: probably best to parameterise the existing tests
  • Extracting multiple files
  • Getting the CRC of a compressed file (already done, but should be renamed for clarity)
  • Getting the CRC of an uncompressed file
  • Extracting a compressed file to memory and the filesystem (already done, but should be renamed for clarity)
  • Extracting an uncompressed file to memory and the filesystem
@Ortham
Copy link
Owner Author

Ortham commented May 3, 2016

I screwed up my local Linux VM, so installed Ubuntu Server 16.04 in a new VM, and didn't encounter any zlib buffer errors, so I'm going to try with a 12.04 image (which is what Travis runs). The only relevant difference I know of is that 12.04's Boost libraries are built using GCC 4, but libbsa is built with GCC 5, whereas 16.04 uses GCC 5 as its default compiler, and there are some ABI differences between the two. Maybe something similar is happening with zlib?

@Ortham
Copy link
Owner Author

Ortham commented May 4, 2016

Solved: zlib was expecting the uncompressed buffer size variable to be a type with the same size as a pointer, which was messing things up on x64 (I had been using a uint32_t), but I'm not sure why it worked with 16.04...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant