summaryrefslogtreecommitdiff
path: root/gi/toggle.h
diff options
context:
space:
mode:
authorMarco Trevisan (Treviño) <mail@3v1n0.net>2021-05-01 22:31:19 +0200
committerMarco Trevisan (Treviño) <mail@3v1n0.net>2021-05-18 00:46:38 +0200
commite45c6d8316a48bd69a4bbed1cfa7839f05104d27 (patch)
treecaddfce3fd13931691144b9186d9a3d6caba9eed /gi/toggle.h
parented6370b90613d4743d5c2a8e568fba0e2f731a8e (diff)
downloadgjs-e45c6d8316a48bd69a4bbed1cfa7839f05104d27.tar.gz
tests: Add unit tests for ToggleQueue and ObjectInstance usage of it
Instead of relying only on (at times unpredictible) JS tests for toggle queue handling and Objects memory management, add unit tests in which we manually handle an ObjectInstance and we simulate toggle events on it.
Diffstat (limited to 'gi/toggle.h')
-rw-r--r--gi/toggle.h6
1 files changed, 6 insertions, 0 deletions
diff --git a/gi/toggle.h b/gi/toggle.h
index 17f22c06..141df552 100644
--- a/gi/toggle.h
+++ b/gi/toggle.h
@@ -17,6 +17,11 @@
#include <utility> // for pair
class ObjectInstance;
+namespace Gjs {
+namespace Test {
+struct ToggleQueue;
+}
+}
/* Thread-safe queue for enqueueing toggle-up or toggle-down events on GObjects
* from any thread. For more information, see object.cpp, comments near
@@ -31,6 +36,7 @@ public:
using Handler = void (*)(ObjectInstance*, Direction);
private:
+ friend Gjs::Test::ToggleQueue;
struct Item {
Item() {}
Item(ObjectInstance* o, Direction d) : object(o), direction(d) {}