Page MenuHomePhabricator

tests: add LCG pseudorandom module
ClosedPublic

Authored by markblundeberg on Feb 1 2019, 18:29.

Details

Summary

(to be used by: sigencoding_tests and radix_tests)

Test Plan

run test_bitcoin

Diff Detail

Repository
rABC Bitcoin ABC
Branch
lcg_standalone
Lint
Lint Passed
Unit
No Test Coverage
Build Status
Buildable 4827
Build 7717: Bitcoin ABC Buildbot (legacy)
Build 7716: arc lint + arc unit

Event Timeline

deadalnix requested changes to this revision.Feb 1 2019, 20:59
deadalnix added inline comments.
src/Makefile.test.include
68 ↗(On Diff #7098)

You need to add the .h here

src/test/lcg.h
15 ↗(On Diff #7098)

The return value is invalid. Only the upper 32 bits are pseudo random.

20 ↗(On Diff #7098)

Constructor goes first.

src/test/lcg_tests.cpp
10 ↗(On Diff #7098)

remove

11 ↗(On Diff #7098)

You may want to start several starting values.

This revision now requires changes to proceed.Feb 1 2019, 20:59

changed to return 32bit; expand attribution & explanation; more tests

deadalnix requested changes to this revision.Feb 1 2019, 22:26

Mostly small changes. It's looking good overall.

src/Makefile.test.include
69 ↗(On Diff #7105)

cpp before h

src/test/lcg.h
23 ↗(On Diff #7105)

You can compute the return value directly here.

24 ↗(On Diff #7105)

and just use state here :)

src/test/lcg_tests.cpp
14 ↗(On Diff #7105)

BOOST_CHECK_EQUAL

This revision now requires changes to proceed.Feb 1 2019, 22:26

changed name; misc comments from amaury

This revision is now accepted and ready to land.Feb 1 2019, 22:37
This revision was automatically updated to reflect the committed changes.