FIX tests namespaces

This commit is contained in:
fastium
2024-12-27 11:13:22 +01:00
committed by Fastium
parent db834de1fd
commit 7d7fb400ff
7 changed files with 64 additions and 43 deletions

View File

@ -29,7 +29,9 @@
#include "unity/unity.h" // NOLINT
#include "utest/utest.h" // NOLINT
namespace utest::v1 {
namespace utest {
namespace v1 {
struct Test {
Test() {
_instanceCount++;
@ -48,7 +50,8 @@ struct Test {
uint32_t Test::_instanceCount = 0;
/**
* Test that a shared pointer correctly manages the lifetime of the underlying raw pointer
* Test that a shared pointer correctly manages the lifetime of the underlying
* raw pointer
*/
void test_single_sharedptr_lifetime() {
// Sanity-check value of counter
@ -66,8 +69,8 @@ void test_single_sharedptr_lifetime() {
}
/**
* Test that multiple instances of shared pointers correctly manage the reference count
* to release the object at the correct point
* Test that multiple instances of shared pointers correctly manage the
* reference count to release the object at the correct point
*/
void test_instance_sharing() {
std::shared_ptr<Test> shared_ptr1(nullptr);
@ -228,7 +231,8 @@ void test_unique_ptr_swap() {
*******************/
/**
* Test that a shared pointer correctly manages the lifetime of the underlying raw pointer
* Test that a shared pointer correctly manages the lifetime of the underlying
* raw pointer
*/
void test_single_raw_ptr_lifetime() {
// Sanity-check value of counter
@ -258,9 +262,9 @@ void test_single_raw_ptr_lifetime() {
TEST_ASSERT_EQUAL(0, Test::_instanceCount);
}
static utest::v1::status_t greentea_setup(const size_t number_of_cases) {
// Here, we specify the timeout (60s) and the host test (a built-in host test or the
// name of our Python file)
static status_t greentea_setup(const size_t number_of_cases) {
// Here, we specify the timeout (60s) and the host test (a built-in host test
// or the name of our Python file)
GREENTEA_SETUP(60, "default_auto");
return greentea_test_setup_handler(number_of_cases);
}
@ -283,5 +287,7 @@ static Case cases[] = {
static Specification specification(greentea_setup, cases);
int main() { return !Harness::run(specification); }
}; // namespace utest::v1
}; // namespace v1
}; // namespace utest
int main() { return !utest::v1::Harness::run(utest::v1::specification); }