Tests : timedata : unittest : median file filter shall not grow beyond size. #14800

pull mmachicao wants to merge 1 commits into bitcoin:master from mmachicao:test_timedata changing 1 files +16 −1
  1. mmachicao commented at 10:09 PM on November 24, 2018: contributor

    Added a new test and applied clang-format

    • By definition size of filter is fixed during construction
    • New entry added at the end and topmost entry is removed when max size is reached.
  2. timedata : unittest : median file filter shall not grow beyond size. applied clang-format eb21318035
  3. fanquake added the label Tests on Nov 24, 2018
  4. in src/test/timedata_tests.cpp:47 in eb21318035
      42 | +
      43 | +    filter.input(100); // 15 100
      44 | +    BOOST_CHECK_EQUAL(filter.size(), 2);
      45 | +
      46 | +    filter.input(10); // 100 10
      47 | +    BOOST_CHECK_EQUAL(filter.size(), 2);
    


    jimmysong commented at 10:31 PM on November 26, 2018:

    Maybe add an unsorted filter check like this?

        BOOST_CHECK_EQUAL(filter[0], 100);
        BOOST_CHECK_EQUAL(filter[1], 10);
    

    mmachicao commented at 7:11 PM on November 29, 2018:

    Hi Jimmy. Class under test is not a vector, so index operations are not available. Otherwise good suggestion. Code is from 2014. Am focusing on tests in order to nail the contract as a basis for potential improvements in the future.

  5. mmachicao commented at 3:45 AM on December 6, 2018: contributor

    Ignore this, as I have a new pull request, that implements contract testing for the AddTimeData procedure.

  6. mmachicao closed this on Dec 6, 2018

  7. mmachicao deleted the branch on Dec 30, 2018
  8. MarcoFalke locked this on Sep 8, 2021
Contributors
Labels

github-metadata-mirror

This is a metadata mirror of the GitHub repository bitcoin/bitcoin. This site is not affiliated with GitHub. Content is generated from a GitHub metadata backup.
generated: 2026-04-22 03:15 UTC

This site is hosted by @0xB10C
More mirrored repositories can be found on mirror.b10c.me