Dummy callbacks for tests #971

pull aahadley-anchorage wants to merge 2 commits into bitcoin-core:master from aahadley-anchorage:master changing 1 files +12 −0
  1. aahadley-anchorage commented at 6:12 pm on September 1, 2021: none
    If external callbacks are specified, the build can fail at link time since these functions aren’t defined yet. Give the linker some definitions to make it happy.
  2. provide dummy callbacks for tests b6032d4d34
  3. make that an ifdef 91e75a6737
  4. aahadley-anchorage marked this as ready for review on Sep 1, 2021
  5. real-or-random commented at 4:43 pm on September 3, 2021: contributor

    Hm, that’s an issue indeed.

    If you use the external callbacks, then you probably do because you don’t have printf or abort on your platform. In tests, we use these function anyway, so I think this change is fine. But wouldn’t it be simpler to #undef USE_EXTERNAL_CALLBACKS?

    Ideally, we’d move into the other direction and make it possible to run the tests without printf. But that’s more complicated.

    I wonder if could we just abuse the external callbacks for exactly that purpose? Instead of making CHECK call abort, we could make this macro reset the default callback and then invoke it. If you don’t have printf or abort, you’d be able provide a different external callback… Except I don’t know how to print the seed then or the final success message. Maybe it’s just cleaner to let the user provide some print function…

  6. real-or-random cross-referenced this on May 11, 2023 from issue build: Make tests work with external default callbacks by real-or-random
  7. real-or-random commented at 5:12 pm on May 11, 2023: contributor
    Closing in favor of #1306
  8. real-or-random closed this on May 11, 2023


github-metadata-mirror

This is a metadata mirror of the GitHub repository bitcoin-core/secp256k1. This site is not affiliated with GitHub. Content is generated from a GitHub metadata backup.
generated: 2024-11-23 09:15 UTC

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