Files
clio/unittests
Michael Legleux b2c1731bcd Fix header and function call (#138)
* RippledState.h --> TrustLine.h

* fix getAffectedAccounts() calls
2022-04-11 13:43:21 -04:00
..
2022-04-11 13:43:21 -04:00

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:

TEST(module_name, test_name)
{
    // Test code goes here
}