diff options
| author | jacqueline <me@jacqueline.id.au> | 2024-06-25 16:09:36 +1000 |
|---|---|---|
| committer | jacqueline <me@jacqueline.id.au> | 2024-06-25 16:09:36 +1000 |
| commit | 525ed2ae1bc710e2a80de0fc10300da83d594ccb (patch) | |
| tree | 49af557432f7e6fc86ae6025f7616137baaa91ad /src/drivers/test/test_samd.cpp | |
| parent | 8db57d6dc5cf5c83cffd393a37ca37bc1a67f1af (diff) | |
| download | tangara-fw-525ed2ae1bc710e2a80de0fc10300da83d594ccb.tar.gz | |
Add a basic overview of writing and running tests
Diffstat (limited to 'src/drivers/test/test_samd.cpp')
| -rw-r--r-- | src/drivers/test/test_samd.cpp | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/src/drivers/test/test_samd.cpp b/src/drivers/test/test_samd.cpp new file mode 100644 index 00000000..c466d88e --- /dev/null +++ b/src/drivers/test/test_samd.cpp @@ -0,0 +1,32 @@ +/* + * Copyright 2023 jacqueline <me@jacqueline.id.au> + * + * SPDX-License-Identifier: GPL-3.0-only + */ + +#include "drivers/samd.hpp" + +#include <cstdint> + +#include "catch2/catch.hpp" + +#include "i2c_fixture.hpp" + +namespace drivers { + +TEST_CASE("samd21 interface", "[integration]") { + I2CFixture i2c; + auto samd = std::make_unique<Samd>(); + + REQUIRE(samd); + + SECTION("usb reports connection") { + samd->UpdateUsbStatus(); + + auto status = samd->GetUsbStatus(); + + REQUIRE(status == Samd::UsbStatus::kAttachedIdle); + } +} + +} // namespace drivers |
