Skip to content

Commit

Permalink
documented running C++ tests and added namespace to conf_str.hpp
Browse files Browse the repository at this point in the history
  • Loading branch information
amunra committed Jan 31, 2024
1 parent 35aaace commit b4f1887
Show file tree
Hide file tree
Showing 4 changed files with 26 additions and 1 deletion.
19 changes: 19 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,22 @@
This is for:
* The [questdb-confstr](./questdb-confstr) crate
* and its bindings for C [questdb-confstr-ffi](./questdb-confstr-ffi)

## Dev notes

To build and test:

```
cargo clean
cargo build
cargo test
cd questdb-confstr-ffi/cpp_test
./compile
./run
```

In addition, before pushing a PR, please run:
```
cargo fmt --all
cargo clippy --all-targets -- -D warnings
```
2 changes: 2 additions & 0 deletions questdb-confstr-ffi/cpp_test/test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,8 @@
#define DOCTEST_CONFIG_IMPLEMENT_WITH_MAIN
#include "doctest.hpp"

using namespace questdb::conf_str;

TEST_CASE("basic no params")
{
const auto c1 = conf_str::parse("http");
Expand Down
4 changes: 4 additions & 0 deletions questdb-confstr-ffi/include/questdb/conf_str.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@
#include <optional>
#include <string_view>

namespace questdb::conf_str
{

class parse_err
{
Expand Down Expand Up @@ -157,3 +159,5 @@ class conf_str
conf_str(::questdb_conf_str* impl) : _impl(impl) {}
::questdb_conf_str* _impl;
};

}
2 changes: 1 addition & 1 deletion questdb-confstr/tests/tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@
*
******************************************************************************/

use std::collections::HashMap;
use questdb_confstr::{parse_conf_str, ErrorKind, ParsingError};
use std::collections::HashMap;

#[test]
fn empty() -> Result<(), ParsingError> {
Expand Down

0 comments on commit b4f1887

Please sign in to comment.