Page MenuHomePhabricator

Add unit tests for seeder's parse_name()

Authored by nakihito on Oct 21 2019, 19:45.


Group Reviewers
Restricted Owners Package(Owns No Changed Paths)
Restricted Project

Adds some unit tests for the seeder's parse_name() function.

Depends on D4275

Test Plan

In your make build dir:

make check
../configure --with-seeder=false
make check

seeder_tests.cpp should not show up during testing

ls src/seeder/

This should only show the test/ directory.

ls src/seeder/test

This should show nothing.

In your cmake build dir:

cmake -GNinja ..
ninja check

rm -r ./*

You can skip this step, but there will be leftover seeder directory and files in the next part if you do.

ninja check
ls src

There should be no seeder directory. If you skipped the rm -r ./* step then you can verify with:

ls -al src
src/test/test_bitcoin --run_test=parse_name_simple

The seeder directory should have an earlier time stamp than everything else.
The command should fail with the following error message:

Test setup error: no test cases matching filter or all test cases were disabled

Diff Detail

rABC Bitcoin ABC
Lint OK
No Unit Test Coverage
Build Status
Buildable 7857
Build 13734: Bitcoin ABC Buildbot (legacy)
Build 13733: arc lint + arc unit

Event Timeline

Owners added a reviewer: Restricted Owners Package.Oct 21 2019, 19:45
nakihito edited the summary of this revision. (Show Details)
nakihito retitled this revision from Add unit tests for parse_name() to Add unit tests for seeder's parse_name().Oct 21 2019, 19:48
jasonbcox requested changes to this revision.Oct 21 2019, 20:44
jasonbcox added inline comments.
149 ↗(On Diff #13632)

This and the test plan are missing BUILD_BITCOIN_SEEDER

34 ↗(On Diff #13632)

Why does this need a static_cast? Won't uint8_t(0) suffice?

This revision now requires changes to proceed.Oct 21 2019, 20:44
34 ↗(On Diff #13632)

Ignore this. I missed that this was a typedef.

Rebased and add if guards for when the project is built without the seeder. Also added CMake.

It would be beneficial to build another executable for the seeder tests.

It would be beneficial to build another executable for the seeder tests.

I'll try and do that.

nakihito requested review of this revision.Nov 8 2019, 19:34

Executable added in D4413.