1#include "../sdl_selectlist.hpp"
2#include "../sdl_input_widgets.hpp"
4#include <freerdp/api.h>
7BOOL sdl_log_error_ex(Uint32 res, wLog* log,
const char* what,
const char* file,
size_t line,
13static bool test_input_dialog()
15 const auto title =
"sometitle";
16 std::vector<std::string> labels;
17 std::vector<std::string> initial;
18 std::vector<Uint32> flags;
19 for (
size_t x = 0; x < 12; x++)
21 labels.push_back(
"label" + std::to_string(x));
22 initial.push_back(std::to_string(x));
26 flag |= SdlInputWidget::SDL_INPUT_MASK;
28 flag |= SdlInputWidget::SDL_INPUT_READONLY;
30 flags.push_back(flag);
33 std::vector<std::string> result;
34 auto rc = list.run(result);
39 if (result.size() != labels.size())
46static bool test_select_dialog()
48 const auto title =
"sometitle";
49 std::vector<std::string> labels;
50 for (
size_t x = 0; x < 12; x++)
52 labels.push_back(
"label" + std::to_string(x));
60 if (
static_cast<size_t>(rc) >= labels.size())
68 FREERDP_API
int TestSDLDialogs(
int argc,
char* argv[]);
71int TestSDLDialogs(
int argc,
char* argv[])
79 SDL_Init(SDL_INIT_VIDEO);
83 if (!test_input_dialog())
87 if (!test_select_dialog())