Page MenuHomePhabricator

Add unit tests for seeder's parse_name()
AbandonedPublic

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

Details

Reviewers
deadalnix
Fabien
jasonbcox
Group Reviewers
Restricted Owners Package(Owns No Changed Paths)
Restricted Project
Summary

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

Depends on D4275

Test Plan

In your make build dir:

../configure
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.

cmake -GNinja -DBUILD_BITCOIN_SEEDER=OFF ..
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

Repository
rABC Bitcoin ABC
Branch
ParseNameUnitTest
Lint
Lint Passed
Unit
No Test Coverage
Build Status
Buildable 7826
Build 13674: Bitcoin ABC Buildbot (legacy)
Build 13673: 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.
src/Makefile.test.include
149

This and the test plan are missing BUILD_BITCOIN_SEEDER

src/seeder/test/seeder_tests.cpp
34

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
src/seeder/test/seeder_tests.cpp
34

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.