Skip to content
Snippets Groups Projects

Compare revisions

Changes are shown as if the source revision was being merged into the target revision. Learn more about comparing revisions.

Source

Select target project
No results found

Target

Select target project
  • caosdb/src/caosdb-cpplib
1 result
Show changes
Commits on Source (4)
......@@ -367,7 +367,8 @@ public:
* This is intended for debugging.
*/
inline auto ToString() const -> const std::string {
google::protobuf::util::JsonOptions options;
google::protobuf::util::JsonPrintOptions options;
options.add_whitespace = true;
std::string out;
google::protobuf::util::MessageToJsonString(*(this->wrapped), &out, options);
return out;
......@@ -538,10 +539,10 @@ public:
* This is intended for debugging
*/
inline auto ToString() const -> const std::string {
google::protobuf::util::JsonOptions options;
google::protobuf::util::JsonPrintOptions options;
options.add_whitespace = true;
std::string out;
google::protobuf::util::MessageToJsonString(*(this->wrapped), &out, options);
return out;
}
......@@ -649,7 +650,8 @@ public:
[[nodiscard]] auto GetInfos() const -> const Messages & { return infos; }
inline auto ToString() const -> const std::string {
google::protobuf::util::JsonOptions options;
google::protobuf::util::JsonPrintOptions options;
options.add_whitespace = true;
std::string out;
google::protobuf::util::MessageToJsonString(*(this->wrapped), &out, options);
return out;
......
......@@ -391,7 +391,8 @@ public:
* For debugging.
*/
inline auto ResponseToString() const -> const std::string {
google::protobuf::util::JsonOptions options;
google::protobuf::util::JsonPrintOptions options;
options.add_whitespace = true;
std::string out;
google::protobuf::util::MessageToJsonString(*this->response, &out, options);
return out;
......@@ -403,7 +404,8 @@ public:
* For debugging.
*/
inline auto RequestToString() const -> const std::string {
google::protobuf::util::JsonOptions options;
google::protobuf::util::JsonPrintOptions options;
options.add_whitespace = true;
std::string out;
google::protobuf::util::MessageToJsonString(*this->request, &out, options);
return out;
......
......@@ -122,7 +122,7 @@ public:
LIST_VALUE_CONSTRUCTOR(char *, set_string_value)
LIST_VALUE_CONSTRUCTOR(bool, set_boolean_value)
[[nodiscard]] inline auto IsNull() -> bool {
[[nodiscard]] inline auto IsNull() const noexcept -> bool {
return this->wrapped->value_case() == ValueCase::VALUE_NOT_SET;
}
......
......@@ -65,6 +65,11 @@ TEST(test_value, test_string) {
EXPECT_FALSE(empty_string.IsInteger());
EXPECT_EQ(empty_string.AsString(), "");
// Test inequality
Value string1("1");
Value int1(1);
EXPECT_FALSE(string1 == int1);
}
TEST(test_value, test_double) {
......