From: Stefan Laner Date: Tue, 15 Oct 2013 13:43:37 +0000 (+0200) Subject: Bugfix in DBusInputStreamTest - &-operator on std::string does not X-Git-Tag: 2.0.9~10 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=efbe5a2677d79c12840f5f4209f200ad181e9664;p=profile%2Fivi%2Fcommon-api-dbus-runtime.git Bugfix in DBusInputStreamTest - &-operator on std::string does not necessarily return a pointer to the contained c string --- diff --git a/src/test/DBusInputStreamTest.cpp b/src/test/DBusInputStreamTest.cpp index eaa33c2..5f66080 100644 --- a/src/test/DBusInputStreamTest.cpp +++ b/src/test/DBusInputStreamTest.cpp @@ -495,7 +495,8 @@ TEST_F(InputStreamTest, ReadsVariantsWithAnArrayOfStrings) { DBusMessageIter innerArrayIter; dbus_message_iter_open_container(&subSubIter, DBUS_TYPE_ARRAY, "s", &innerArrayIter); for (unsigned int i = 0; i < numOfElements; i++) { - dbus_message_iter_append_basic(&innerArrayIter, DBUS_TYPE_STRING, &testInnerVector[i]); + char* testPtr = strdup(testInnerVector[i].c_str()); + dbus_message_iter_append_basic(&innerArrayIter, DBUS_TYPE_STRING, &testPtr); } dbus_message_iter_close_container(&subSubIter, &innerArrayIter);