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

Avoid calling exit from within a library #1110

Closed
1 of 17 tasks
abitmore opened this issue Jul 2, 2018 · 2 comments
Closed
1 of 17 tasks

Avoid calling exit from within a library #1110

abitmore opened this issue Jul 2, 2018 · 2 comments
Assignees

Comments

@abitmore
Copy link
Member

abitmore commented Jul 2, 2018

Bug Description
As reported by @nanomobile at #1104 (comment), we have several code that exiting from within a library, which makes them hard to test with boost unit testing framework.

  1. https://github.com/bitshares/bitshares-core/blob/master/libraries/app/application.cpp#L425
  2. https://github.com/bitshares/bitshares-core/blob/master/libraries/app/application.cpp#L988
  3. https://github.com/bitshares/bitshares-core/blob/master/libraries/app/application.cpp#L1019

Libraries should not call exit directly, instead, should call return or throw.

Impacts
Describe which portion(s) of BitShares Core may be impacted by this bug. Please tick at least one box.

  • API (the application programming interface)
  • Build (the build process or something prior to compiled code)
  • CLI (the command line wallet)
  • Deployment (the deployment process after building such as Docker, Travis, etc.)
  • DEX (the Decentralized EXchange, market engine, etc.)
  • P2P (the peer-to-peer network for transaction/block propagation)
  • Performance (system or user efficiency, etc.)
  • Protocol (the blockchain logic, consensus, validation, etc.)
  • Security (the security of system or user data, etc.)
  • UX (the User Experience)
  • Testing

Steps To Reproduce

  • Write a test case which will trigger the exit;
  • make and run tests/chain_test;
  • tests/chain_test will exit unexpectedly after that test case.

Expected Behavior
tests/chain_test will run all test cases.

CORE TEAM TASK LIST

  • Evaluate / Prioritize Bug Report
  • Refine User Stories / Requirements
  • Define Test Cases
  • Design / Develop Solution
  • Perform QA/Testing
  • Update Documentation
@abitmore
Copy link
Member Author

abitmore commented Jul 2, 2018

@nanomobile thanks. The editline examples should be OK.

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

No branches or pull requests

3 participants