Skip to content
Snippets Groups Projects

First unit tests

Merged Leon Dietrich requested to merge first_unit_tests into master
Compare and Show latest version
24 files
+ 559
522
Compare changes
  • Side-by-side
  • Inline
Files
24
+ 34
31
@@ -25,16 +25,16 @@ int constexpr chartext{A_CHARTEXT};
namespace internal {
struct DefaultColor {
operator short() const {
static bool init_done{false};
operator short() const {
static bool init_done{false};
if (!init_done) {
ncurses().use_default_colors();
init_done = true;
}
if (!init_done) {
ncurses().use_default_colors();
init_done = true;
}
return -1;
}
return -1;
}
};
} // namespace internal
@@ -59,10 +59,10 @@ short constexpr white{COLOR_WHITE};
namespace internal {
struct FunctionKeys {
int operator()(int n) const {
assert(n < 64 && "Function key doesn't exists");
return KEY_F0 + n;
}
int operator()(int n) const {
assert(n < 64 && "Function key doesn't exists");
return KEY_F0 + n;
}
};
}
@@ -163,46 +163,49 @@ int constexpr suspend{KEY_SUSPEND};
int constexpr undo{KEY_UNDO};
int constexpr mouse{KEY_MOUSE};
int constexpr resize{KEY_RESIZE};
//int constexpr event{KEY_EVENT}; // TODO fimxe
#ifdef KEY_EVENT
int constexpr event{KEY_EVENT};
#endif
} // namespace keys
namespace internal {
struct ButtonRelease {
mmask_t operator()(mmask_t event, unsigned char button) const {
return BUTTON_RELEASE(event, button);
}
mmask_t operator()(mmask_t event, unsigned char button) const {
return BUTTON_RELEASE(event, button);
}
};
struct ButtonPress {
mmask_t operator()(mmask_t event, unsigned char button) const {
return BUTTON_PRESS(event, button);
}
mmask_t operator()(mmask_t event, unsigned char button) const {
return BUTTON_PRESS(event, button);
}
};
struct ButtonClick {
mmask_t operator()(mmask_t event, unsigned char button) const {
return BUTTON_CLICK(event, button);
}
mmask_t operator()(mmask_t event, unsigned char button) const {
return BUTTON_CLICK(event, button);
}
};
struct ButtonDoubleClick {
mmask_t operator()(mmask_t event, unsigned char button) const {
return BUTTON_DOUBLE_CLICK(event, button);
}
mmask_t operator()(mmask_t event, unsigned char button) const {
return BUTTON_DOUBLE_CLICK(event, button);
}
};
struct ButtonTripleClick {
mmask_t operator()(mmask_t event, unsigned char button) const {
return BUTTON_TRIPLE_CLICK(event, button);
}
mmask_t operator()(mmask_t event, unsigned char button) const {
return BUTTON_TRIPLE_CLICK(event, button);
}
};
struct ButtonReserved {
mmask_t operator()(mmask_t event, unsigned char button) const {
return BUTTON_RESERVED_EVENT(event, button);
}
mmask_t operator()(mmask_t event, unsigned char button) const {
return BUTTON_RESERVED_EVENT(event, button);
}
};
}
Loading