diff --git a/README.md b/README.md index 32f2aeac..5446ab8a 100644 --- a/README.md +++ b/README.md @@ -42,7 +42,7 @@ Use these instructions to build a clio executable from source. These instruction ./bootstrap.sh ./b2 -j$((`nproc`+1)) # Add the following 'export' command - # to your profile file (/~.profile): + # to your profile file (~/.profile): # ------------------------------- export BOOST_ROOT=/home/my_user/boost_1_75_0 source ~/.profile diff --git a/src/backend/README.md b/src/backend/README.md index ff2fa353..d0ca2dc6 100644 --- a/src/backend/README.md +++ b/src/backend/README.md @@ -7,7 +7,7 @@ where nodes can prove that a piece of data is present in a ledger by sending the path from root to leaf. Other nodes can verify this path and be certain that the data does actually exist in the ledger in question. -clio instead flattens the data model, so lookups are 0(1). This results in time +clio instead flattens the data model, so lookups are O(1). This results in time and space savings. This is possible because clio does not participate in the peer to peer protocol, and thus does not need to verify any data. clio fully trusts the rippled nodes that are being used as a data source. diff --git a/unittests/README.md b/unittests/README.md new file mode 100644 index 00000000..4a0a4282 --- /dev/null +++ b/unittests/README.md @@ -0,0 +1,31 @@ +# Unit Testing +The correctness of new implementations can be verified via running unit tests. Below are the information on how to run unit tests. +## Requirements +### 1. Cassandra cluster +Have access to a **local (127.0.0.1)** Cassandra cluster, opened at port **9042**. Please ensure that the cluster is successfully running before running Unit Tests. +### 2. Postgres server +Have access to a **local (127.0.0.1)** Postgres server, opened at port **5432**. The server must also have a super user named **postgres** with password set to **postgres**. In addition, modify *postgresql.conf* with the following field values: +``` +max_connections = 1000 +shared_buffers = 1280MB +``` +## Running +To run the unit tests, first build Clio as normal, then execute `./clio_tests` to run the unit tests. + +## Tests +Below is a list of currently available unit tests. Please keep in mind that this list should be constantly updated with new unit tests as new features are added to the project. + +- BackendTest.basic +- Backend.cache +- Backend.cacheBackground +- Backend.cacheIntegration + +# Adding Unit Tests +To add unit tests, append a new test block in the unittests/main.cpp file with the following format: + +```cpp +TEST(module_name, test_name) +{ + // Test code goes here +} +``` \ No newline at end of file diff --git a/unittests/main.cpp b/unittests/main.cpp index 2deb793f..72974ee3 100644 --- a/unittests/main.cpp +++ b/unittests/main.cpp @@ -1642,7 +1642,7 @@ TEST(Backend, cacheBackground) ASSERT_EQ(idx, allObjs.size()); } -TEST(Backend, CacheIntegration) +TEST(Backend, cacheIntegration) { boost::asio::io_context ioc; std::optional work;