mirror of
https://github.com/eried/portapack-mayhem.git
synced 2025-06-21 13:24:30 -04:00
Allows apps using app settings to use global frequency (#1148)
* Allow apps to not use persisted freq. * use rx_freq for RX mode * remove direct call to persistant_memory in tx_model * app_setting defaults, and tx_view to use ctor value
This commit is contained in:
parent
ccd7bd6fc2
commit
3db2053c21
9 changed files with 81 additions and 32 deletions
|
@ -22,7 +22,7 @@
|
|||
#include "doctest.h"
|
||||
#include "utility.hpp"
|
||||
|
||||
TEST_SUITE_BEGIN("flags_enabled");
|
||||
TEST_SUITE_BEGIN("Flags operators");
|
||||
|
||||
enum class Flags : uint8_t {
|
||||
A = 0x1,
|
||||
|
@ -30,14 +30,21 @@ enum class Flags : uint8_t {
|
|||
C = 0x4,
|
||||
};
|
||||
|
||||
ENABLE_FLAGS_OPERATORS(Flags);
|
||||
|
||||
TEST_CASE("operator| should combine flags.") {
|
||||
constexpr Flags f = Flags::A | Flags::C;
|
||||
static_assert(static_cast<int>(f) == 5);
|
||||
}
|
||||
|
||||
TEST_CASE("When flag set, flags_enabled should be true.") {
|
||||
Flags f = Flags::A;
|
||||
CHECK(flags_enabled(f, Flags::A));
|
||||
constexpr Flags f = Flags::A;
|
||||
static_assert(flags_enabled(f, Flags::A));
|
||||
}
|
||||
|
||||
TEST_CASE("When flag not set, flags_enabled should be false.") {
|
||||
Flags f = Flags::B;
|
||||
CHECK(flags_enabled(f, Flags::A) == false);
|
||||
constexpr Flags f = Flags::B;
|
||||
static_assert(flags_enabled(f, Flags::A) == false);
|
||||
}
|
||||
|
||||
TEST_SUITE_END();
|
Loading…
Add table
Add a link
Reference in a new issue