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 4820
Build 7703: Bitcoin ABC Buildbot (legacy)
Build 7702: 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

You need to add the .h here

src/test/lcg.h
15

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

20

Constructor goes first.

src/test/lcg_tests.cpp
10

remove

11

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.