summaryrefslogtreecommitdiffstats
path: root/test/src
diff options
context:
space:
mode:
authorDavid Snopek <dsnopek@gmail.com>2023-07-22 09:04:27 -0500
committerGitHub <noreply@github.com>2023-07-22 09:04:27 -0500
commit3162be28e594bf5b17889117670fc6f2d75f2f0c (patch)
tree6791bbf863ba6df551439350e9828cd2818dec2d /test/src
parentef5a185dc42e69ace0a2844069e5a8c36929d931 (diff)
parent4df112cd95840313600d0f850ec52a56d0961386 (diff)
downloadredot-cpp-3162be28e594bf5b17889117670fc6f2d75f2f0c.tar.gz
Merge pull request #1150 from dsnopek/charstring-full
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 34ee355..fb47dd8 100644
--- a/test/src/example.cpp
+++ b/test/src/example.cpp
@@ -138,6 +138,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);
@@ -299,6 +300,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 a330030..a84efed 100644
--- a/test/src/example.h
+++ b/test/src/example.h
@@ -117,6 +117,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);