summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorMarco Trevisan (Treviño) <mail@3v1n0.net>2020-10-14 02:43:31 +0200
committerMarco Trevisan (Treviño) <mail@3v1n0.net>2020-10-27 12:50:05 +0100
commitf7d36e7c6a2ce729ac3d375f7d5d94b7a6c908d4 (patch)
treefb34ac3b17400f7aa69d3fce41b591f0d89d7e74 /test
parent76563efb16f563cb337701da65b63cefa261aed7 (diff)
downloadgjs-f7d36e7c6a2ce729ac3d375f7d5d94b7a6c908d4.tar.gz
jsapi-util: Add out operator to get the double pointer
Diffstat (limited to 'test')
-rw-r--r--test/gjs-test-jsapi-utils.cpp9
1 files changed, 9 insertions, 0 deletions
diff --git a/test/gjs-test-jsapi-utils.cpp b/test/gjs-test-jsapi-utils.cpp
index 6d3f0dd6..f9ed9adb 100644
--- a/test/gjs-test-jsapi-utils.cpp
+++ b/test/gjs-test-jsapi-utils.cpp
@@ -369,6 +369,13 @@ static void test_gjs_autopointer_get() {
g_assert(ptr == autoptr.get());
}
+static void test_gjs_autopointer_out() {
+ auto* ptr = gjs_test_object_new();
+ GjsAutoTestObject autoptr(ptr);
+
+ g_assert(ptr == *(autoptr.out()));
+}
+
static void test_gjs_autopointer_release() {
auto* ptr = gjs_test_object_new();
GjsAutoTestObject autoptr(ptr);
@@ -615,6 +622,8 @@ void gjs_test_add_tests_for_jsapi_utils(void) {
test_gjs_autopointer_assign_operator_array);
g_test_add_func("/gjs/jsapi-utils/gjs-autopointer/method/get",
test_gjs_autopointer_get);
+ g_test_add_func("/gjs/jsapi-utils/gjs-autopointer/method/out",
+ test_gjs_autopointer_out);
g_test_add_func("/gjs/jsapi-utils/gjs-autopointer/method/release",
test_gjs_autopointer_release);
g_test_add_func("/gjs/jsapi-utils/gjs-autopointer/method/reset/nullptr",