summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--test/controls/control_value.cpp22
1 files changed, 22 insertions, 0 deletions
diff --git a/test/controls/control_value.cpp b/test/controls/control_value.cpp
index a7ebf60f..ad8e05d0 100644
--- a/test/controls/control_value.cpp
+++ b/test/controls/control_value.cpp
@@ -235,6 +235,28 @@ protected:
return TestFail;
}
+ /*
+ * String type.
+ */
+ std::string string{ "libcamera" };
+ value.set(string);
+ if (value.isNone() || !value.isArray() ||
+ value.type() != ControlTypeString ||
+ value.numElements() != string.size()) {
+ cerr << "Control type mismatch after setting to string" << endl;
+ return TestFail;
+ }
+
+ if (value.get<std::string>() != string) {
+ cerr << "Control value mismatch after setting to string" << endl;
+ return TestFail;
+ }
+
+ if (value.toString() != string) {
+ cerr << "Control string mismatch after setting to string" << endl;
+ return TestFail;
+ }
+
return TestPass;
}
};