summaryrefslogtreecommitdiffstats
path: root/test/src
diff options
context:
space:
mode:
authorDavid Snopek <dsnopek@gmail.com>2023-06-20 10:03:15 -0500
committerDavid Snopek <dsnopek@gmail.com>2023-06-22 21:03:30 -0500
commit4df112cd95840313600d0f850ec52a56d0961386 (patch)
tree80e717904646e51e56b0afea2965bc8b0b7cceec /test/src
parent2377f7ec7505645a328bec6ec91bf17aa4e471c3 (diff)
downloadredot-cpp-4df112cd95840313600d0f850ec52a56d0961386.tar.gz
Attempt to fully implement CharString
Diffstat (limited to 'test/src')
-rw-r--r--test/src/example.cpp5
-rw-r--r--test/src/example.h1
2 files changed, 6 insertions, 0 deletions
diff --git a/test/src/example.cpp b/test/src/example.cpp
index 6c5e736..6d67931 100644
--- a/test/src/example.cpp
+++ b/test/src/example.cpp
@@ -128,6 +128,7 @@ void Example::_bind_methods() {
ClassDB::bind_method(D_METHOD("test_node_argument"), &Example::test_node_argument);
ClassDB::bind_method(D_METHOD("test_string_ops"), &Example::test_string_ops);
ClassDB::bind_method(D_METHOD("test_str_utility"), &Example::test_str_utility);
+ ClassDB::bind_method(D_METHOD("test_string_is_fourty_two"), &Example::test_string_is_fourty_two);
ClassDB::bind_method(D_METHOD("test_vector_ops"), &Example::test_vector_ops);
ClassDB::bind_method(D_METHOD("test_bitfield", "flags"), &Example::test_bitfield);
@@ -285,6 +286,10 @@ String Example::test_str_utility() const {
return UtilityFunctions::str("Hello, ", "World", "! The answer is ", 42);
}
+bool Example::test_string_is_fourty_two(const String &p_string) const {
+ return strcmp(p_string.utf8().ptr(), "fourty two") == 0;
+}
+
int Example::test_vector_ops() const {
PackedInt32Array arr;
arr.push_back(10);
diff --git a/test/src/example.h b/test/src/example.h
index 7f1b5b2..3553763 100644
--- a/test/src/example.h
+++ b/test/src/example.h
@@ -116,6 +116,7 @@ public:
Example *test_node_argument(Example *p_node) const;
String test_string_ops() const;
String test_str_utility() const;
+ bool test_string_is_fourty_two(const String &p_str) const;
int test_vector_ops() const;
BitField<Flags> test_bitfield(BitField<Flags> flags);