hyprutils/tests/signal.cpp
nyx 9be03a8562
misc: fix some compile warnings (#25)
- Cleans up compile warnings
- Formats code
- Cleans up unused vars
- etc
2024-12-25 19:10:14 +00:00

28 lines
No EOL
524 B
C++

#include <hyprutils/signal/Signal.hpp>
#include <hyprutils/memory/WeakPtr.hpp>
#include "shared.hpp"
using namespace Hyprutils::Signal;
using namespace Hyprutils::Memory;
int main(int argc, char** argv, char** envp) {
int ret = 0;
CSignal signal;
int data = 0;
auto listener = signal.registerListener([&]([[maybe_unused]] std::any d) { data = 1; });
signal.emit();
EXPECT(data, 1);
data = 0;
listener.reset();
signal.emit();
EXPECT(data, 0);
return ret;
}