Skip to content

[Easy] Bad tests in betting_tests #374

@nathanielhourt

Description

@nathanielhourt

Bug Description
The tests in betting_tests.cpp make extensive use of the macros near the top of the file that set up a canned test scenario so that individual test cases can test various subsequent operations within that canned scenario.

Unfortunately, these macros are improperly written leading to abuse of RAM and spurious test failures. The macros, over the course of several blocks, create several objects and store references to these objects for later use. This is not permitted: Graphene object references are invalidated at each block, so it is not valid to keep a reference (or pointer) across block boundaries. Instead, keep the ID, and look up the object by ID after each block.

These macros (and the tests) must be rewritten to store IDs rather than references.

Impacts
Describe which portion(s) of Peerplays 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, Gitlab, 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)
  • Other (Tests)

PBSA / Developer tasks

  • Evaluate / Prioritize Bug Report
  • Refine User Stories / Requirements
  • Define Test Cases
  • Design / Develop Solution
  • Perform QA/Testing
  • Update Documentation

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions