2026-06-18 19:32:27 -05:00
|
|
|
#include "test_support.hpp"
|
|
|
|
|
|
2026-06-18 19:40:23 -05:00
|
|
|
#include <izo/Clipboard.hpp>
|
|
|
|
|
#include <izo/Dialogs.hpp>
|
|
|
|
|
#include <izo/Environment.hpp>
|
|
|
|
|
#include <izo/MessageBox.hpp>
|
2026-06-18 21:08:22 -05:00
|
|
|
#include <izo/Notifications.hpp>
|
|
|
|
|
#include <izo/System.hpp>
|
2026-06-18 19:32:27 -05:00
|
|
|
|
|
|
|
|
int main() {
|
|
|
|
|
std::string error;
|
2026-06-18 19:40:23 -05:00
|
|
|
CHECK(izo::SetEnvVar("PATH", "", &error));
|
2026-06-18 19:32:27 -05:00
|
|
|
|
2026-06-18 19:40:23 -05:00
|
|
|
auto dialog = izo::OpenFile();
|
|
|
|
|
CHECK(dialog.status == izo::DialogStatus::Error);
|
|
|
|
|
CHECK(!dialog.errorMessage.empty());
|
|
|
|
|
dialog = izo::SaveFile();
|
|
|
|
|
CHECK(dialog.status == izo::DialogStatus::Error);
|
|
|
|
|
dialog = izo::PickFolder();
|
|
|
|
|
CHECK(dialog.status == izo::DialogStatus::Error);
|
2026-06-18 19:32:27 -05:00
|
|
|
|
|
|
|
|
error.clear();
|
2026-06-18 19:40:23 -05:00
|
|
|
CHECK(!izo::OpenPath("/tmp", &error));
|
2026-06-18 19:32:27 -05:00
|
|
|
CHECK(!error.empty());
|
|
|
|
|
error.clear();
|
2026-06-18 19:40:23 -05:00
|
|
|
CHECK(!izo::RevealInFileManager("/tmp/file", &error));
|
2026-06-18 19:32:27 -05:00
|
|
|
CHECK(!error.empty());
|
|
|
|
|
|
|
|
|
|
error.clear();
|
2026-06-18 19:40:23 -05:00
|
|
|
CHECK(izo::ShowMessageBox({"title", "message"}, &error) == izo::MessageResponse::Error);
|
2026-06-18 19:32:27 -05:00
|
|
|
CHECK(!error.empty());
|
|
|
|
|
error.clear();
|
2026-06-18 21:00:51 -05:00
|
|
|
CHECK(izo::ShowErrorBox("title", "message", &error) == izo::MessageResponse::Error);
|
|
|
|
|
CHECK(!error.empty());
|
|
|
|
|
error.clear();
|
|
|
|
|
CHECK(izo::ShowQuestionBox("title", "message", &error) == izo::MessageResponse::Error);
|
|
|
|
|
CHECK(!error.empty());
|
|
|
|
|
const auto input = izo::ShowInputBox({"title", "message", "initial"});
|
|
|
|
|
CHECK(input.response == izo::MessageResponse::Error);
|
|
|
|
|
CHECK(!input.errorMessage.empty());
|
|
|
|
|
const auto color = izo::PickColor({"title", {1, 2, 3}});
|
|
|
|
|
CHECK(color.response == izo::MessageResponse::Error);
|
|
|
|
|
CHECK(!color.errorMessage.empty());
|
|
|
|
|
error.clear();
|
2026-06-18 19:40:23 -05:00
|
|
|
CHECK(!izo::SetClipboardText({}, &error));
|
2026-06-18 19:32:27 -05:00
|
|
|
CHECK(!error.empty());
|
|
|
|
|
error.clear();
|
2026-06-18 19:40:23 -05:00
|
|
|
CHECK(!izo::GetClipboardText(&error));
|
2026-06-18 19:32:27 -05:00
|
|
|
CHECK(!error.empty());
|
2026-06-18 21:08:22 -05:00
|
|
|
error.clear();
|
|
|
|
|
CHECK(!izo::SetClipboardFiles({}, &error));
|
|
|
|
|
CHECK(!error.empty());
|
|
|
|
|
error.clear();
|
|
|
|
|
CHECK(!izo::GetClipboardFiles(&error));
|
|
|
|
|
CHECK(!error.empty());
|
|
|
|
|
error.clear();
|
|
|
|
|
CHECK(!izo::SetClipboardImage({1, 1, {}}, &error));
|
|
|
|
|
CHECK(!error.empty());
|
|
|
|
|
error.clear();
|
|
|
|
|
CHECK(!izo::ShowNotification("title", "message", &error));
|
|
|
|
|
CHECK(!error.empty());
|
|
|
|
|
error.clear();
|
|
|
|
|
CHECK(!izo::PreventSleep(&error));
|
|
|
|
|
CHECK(!error.empty());
|
|
|
|
|
CHECK(izo::AllowSleep());
|
2026-06-18 19:32:27 -05:00
|
|
|
}
|