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

Re-enable testing suite #43

Merged

Conversation

bitcoinx2
Copy link
Collaborator

Reactivate the existing testing suite. Closes #4

These tests have apparently not used since the beginning of Spectrecoin. Most test vectors still refer to the base58 prefixes of ShadowCash (SDC) which is (presumably) the main reason why tests are failing.

Most notable changes:

  • Add testing executable to CmakeLists (only for Linux at this point)
  • Fix compilation issues that are due to changed function calls or removed functionality
  • Update test vectors to reflect changes to the base58 prefixes

For changing the test vectors I assume that the tests themselves are still correct, i.e. I simply inserted the values expected by the test. Admittedly this is a bad practice but serves as a starting point to see which test units are still compatible with our current code base in general. Future work should focus on reviewing the used test values and verifying their plausibility with regards to the desired behavior of the wallet.

As it stands now, the tests can still be used for regression testing, i.e. verifying that future code changes do not change the current behavior of the wallet (which might not necessarily be the desired behavior).

There are still some open issues which appear on my system (linux 64 bit):

pathTemp /tmp/test_alias_1638013645_11356
Running 85 test cases...
1
unknown location(0): fatal error: in "extkey_tests/extkey_serialise": std::ios_base::failure[abi:cxx11]: CDataStream::read() : end of data: iostream error
.../alias-wallet/src/test/extkey_tests.cpp(337): last checkpoint
unknown location(0): fatal error: in "key_tests/key_test1": memory access violation at address: 0x00000010: no mapping at fault address
.../alias-wallet/src/test/key_tests.cpp(155): last checkpoint

*** 2 failures are detected in the test module "Alias Test Suite"

According to my investigation so far, extkey_tests/extkey_serialise fails in case of de-serialization of an empty vector of <unsigned char>. This might in fact be a bug in the code base, not in the test. I don't know what the desired serialization should look like.

I didn't investigate the memory access violation yet.

The current changes have only been tested on Linux so the build will probably fail for other platforms.

HLXEasy and others added 23 commits October 11, 2020 09:02
Prevents interfering with testing which uses its own init and shutdown routines
Undo changes done in commit 579b231
Previously broken by commit 84c4eac (removed messaging capability)
Previously broken by commit e6e0018 (changed base58Prefixes)

The values used here are simply those expected by the test.
Please review them for plausibility!
Previously broken by commit e6e0018 (changed base58Prefixes)

The values used here are simply those expected by the test.
Please review them for plausibility!
Previously broken by commit e6e0018 (removed checkpoints)
Previously broken by commit e6e0018 (changed base58Prefixes)

The values used here are simply those expected by the test.
Please review them for plausibility!
The values used here are simply those expected by the test.
Please review them for plausibility!
@HLXEasy HLXEasy merged commit 689b7c3 into aliascash:feature/reactivateUnittests Dec 4, 2021
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

Successfully merging this pull request may close these issues.

2 participants