From 419a1983ca6bdb32cf0ecd297f7ffccf518d2424 Mon Sep 17 00:00:00 2001 From: practicalswift Date: Wed, 23 May 2018 14:56:49 +0200 Subject: [PATCH 1/2] docs: Add a note about the source code filename naming convention --- doc/developer-notes.md | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/doc/developer-notes.md b/doc/developer-notes.md index 1f237b750..960c6a024 100644 --- a/doc/developer-notes.md +++ b/doc/developer-notes.md @@ -567,6 +567,12 @@ Source code organization - *Rationale*: Shorter and simpler header files are easier to read, and reduce compile time +- Use only the lowercase alphanumerics (`a-z0-9`), underscore (`_`) and hyphen (`-`) in source code filenames. + + - *Rationale*: `grep`:ing and auto-completing filenames is easier when using a consistent + naming pattern. Potential problems when building on case-insensitive filesystems are + avoided when using only lowercase characters in source code filenames. + - Every `.cpp` and `.h` file should `#include` every header file it directly uses classes, functions or other definitions from, even if those headers are already included indirectly through other headers. From e56771365b446fa7f51a17d67f3fbe560baaa5a5 Mon Sep 17 00:00:00 2001 From: practicalswift Date: Wed, 23 May 2018 14:14:58 +0200 Subject: [PATCH 2/2] Do not use uppercase characters in source code filenames --- src/Makefile.bench.include | 2 +- src/Makefile.test.include | 4 ++-- src/bench/{Examples.cpp => examples.cpp} | 0 src/net_processing.cpp | 2 +- src/test/{DoS_tests.cpp => denialofservice_tests.cpp} | 2 +- src/test/{script_P2SH_tests.cpp => script_p2sh_tests.cpp} | 2 +- 6 files changed, 6 insertions(+), 6 deletions(-) rename src/bench/{Examples.cpp => examples.cpp} (100%) rename src/test/{DoS_tests.cpp => denialofservice_tests.cpp} (99%) rename src/test/{script_P2SH_tests.cpp => script_p2sh_tests.cpp} (99%) diff --git a/src/Makefile.bench.include b/src/Makefile.bench.include index 3306dcf59..e5db76703 100644 --- a/src/Makefile.bench.include +++ b/src/Makefile.bench.include @@ -17,7 +17,7 @@ bench_bench_bitcoin_SOURCES = \ bench/bench.h \ bench/checkblock.cpp \ bench/checkqueue.cpp \ - bench/Examples.cpp \ + bench/examples.cpp \ bench/rollingbloom.cpp \ bench/crypto_hash.cpp \ bench/ccoins_caching.cpp \ diff --git a/src/Makefile.test.include b/src/Makefile.test.include index 7174b3e8d..88ab44042 100644 --- a/src/Makefile.test.include +++ b/src/Makefile.test.include @@ -46,7 +46,7 @@ BITCOIN_TESTS =\ test/compress_tests.cpp \ test/crypto_tests.cpp \ test/cuckoocache_tests.cpp \ - test/DoS_tests.cpp \ + test/denialofservice_tests.cpp \ test/getarg_tests.cpp \ test/hash_tests.cpp \ test/key_io_tests.cpp \ @@ -71,7 +71,7 @@ BITCOIN_TESTS =\ test/rpc_tests.cpp \ test/sanity_tests.cpp \ test/scheduler_tests.cpp \ - test/script_P2SH_tests.cpp \ + test/script_p2sh_tests.cpp \ test/script_tests.cpp \ test/script_standard_tests.cpp \ test/scriptnum_tests.cpp \ diff --git a/src/bench/Examples.cpp b/src/bench/examples.cpp similarity index 100% rename from src/bench/Examples.cpp rename to src/bench/examples.cpp diff --git a/src/net_processing.cpp b/src/net_processing.cpp index ed2fb598d..26d5fb6b6 100644 --- a/src/net_processing.cpp +++ b/src/net_processing.cpp @@ -560,7 +560,7 @@ static void FindNextBlocksToDownload(NodeId nodeid, unsigned int count, std::vec } // namespace // This function is used for testing the stale tip eviction logic, see -// DoS_tests.cpp +// denialofservice_tests.cpp void UpdateLastBlockAnnounceTime(NodeId node, int64_t time_in_seconds) { LOCK(cs_main); diff --git a/src/test/DoS_tests.cpp b/src/test/denialofservice_tests.cpp similarity index 99% rename from src/test/DoS_tests.cpp rename to src/test/denialofservice_tests.cpp index 1868aed7d..e5f914ba8 100644 --- a/src/test/DoS_tests.cpp +++ b/src/test/denialofservice_tests.cpp @@ -42,7 +42,7 @@ static NodeId id = 0; void UpdateLastBlockAnnounceTime(NodeId node, int64_t time_in_seconds); -BOOST_FIXTURE_TEST_SUITE(DoS_tests, TestingSetup) +BOOST_FIXTURE_TEST_SUITE(denialofservice_tests, TestingSetup) // Test eviction of an outbound peer whose chain never advances // Mock a node connection, and use mocktime to simulate a peer diff --git a/src/test/script_P2SH_tests.cpp b/src/test/script_p2sh_tests.cpp similarity index 99% rename from src/test/script_P2SH_tests.cpp rename to src/test/script_p2sh_tests.cpp index 63d211dd9..803a673fa 100644 --- a/src/test/script_P2SH_tests.cpp +++ b/src/test/script_p2sh_tests.cpp @@ -46,7 +46,7 @@ Verify(const CScript& scriptSig, const CScript& scriptPubKey, bool fStrict, Scri } -BOOST_FIXTURE_TEST_SUITE(script_P2SH_tests, BasicTestingSetup) +BOOST_FIXTURE_TEST_SUITE(script_p2sh_tests, BasicTestingSetup) BOOST_AUTO_TEST_CASE(sign) {