- If http_proxy environment not defined, std::getenv return nullptr. We didn't consider this case
- If we use Dali::Accessibility::TestEnableSC() without DBusWrapper::Install(std::unique_ptr<DBusWrapper>(new TestDBusWrapper)), it will be crashed.
Change-Id: I51247ce8ac37d1080cc29980debef4024ba0b104
Signed-off-by: Eunki Hong <eunkiki.hong@samsung.com>
static bool ScreenReaderEnabled = false;
static bool IsEnabled = false;
- auto wr = static_cast<TestDBusWrapper*>(DBusWrapper::Installed());
+ auto* dbusWrapper = DBusWrapper::Installed();
+ auto* wr = dynamic_cast<TestDBusWrapper*>(dbusWrapper);
+ if(wr == nullptr)
+ {
+ fprintf(stderr, "Wrong case! TestDBusWrapper was not installed! have you forget to call DBusWrapper::Install(std::unique_ptr<DBusWrapper>(new TestDBusWrapper)); at startup?\n");
+ std::abort();
+ }
wr->testMethods[std::tuple<std::string, std::string, std::string, MethodType>{"/org/a11y/bus", "org.a11y.Status", "ScreenReaderEnabled", MethodType::Getter}] = [wr](const MessagePtr& m) -> MessagePtr {
auto reply = wr->newReplyMessage(m);
void utc_dali_toolkit_accessibility_accessible_cleanup(void)
{
test_return_value = TET_PASS;
+ DBusWrapper::Install({}); // Clean up TestDBusWrapper
}
int utcDaliAccessibilityCheckBoxButtonGetStates(void)
};
}
+void utc_dali_toolkit_accessibility_control_bridgeup_startup(void)
+{
+ test_return_value = TET_UNDEF;
+ DBusWrapper::Install(std::unique_ptr<DBusWrapper>(new TestDBusWrapper));
+}
+
+void utc_dali_toolkit_accessibility_control_bridgeup_cleanup(void)
+{
+ test_return_value = TET_PASS;
+ DBusWrapper::Install({}); // Clean up TestDBusWrapper
+}
+
namespace Dali
{
namespace Accessibility
void utc_dali_accessibility_controls_cleanup(void)
{
test_return_value = TET_PASS;
- //DBusWrapper::Install({}) is a de-install
- DBusWrapper::Install({});
+ DBusWrapper::Install({}); // Clean up TestDBusWrapper
}
int UtcDaliControlAccessibileGet01(void)
void utc_dali_toolkit_accessibility_text_cleanup(void)
{
test_return_value = TET_PASS;
+ DBusWrapper::Install({}); // Clean up TestDBusWrapper
}
int utcDaliAccessibilityTextEditorGetName(void)
void utc_dali_toolkit_accessibility_value_cleanup(void)
{
test_return_value = TET_PASS;
+ DBusWrapper::Install({}); // Clean up TestDBusWrapper
}
int utcDaliAccessibilityProgressBarGetMinimum(void)
void dali_color_conversion_cleanup(void)
{
test_return_value = TET_PASS;
+#if defined(ELDBUS_ENABLED)
+ DBusWrapper::Install({}); // Clean up TestDBusWrapper
+#endif
}
int UtcDaliPropertyHelperConvertHtmlStringToColor(void)
void dali_debug_rendering_cleanup(void)
{
test_return_value = TET_PASS;
+#if defined(ELDBUS_ENABLED)
+ DBusWrapper::Install({}); // Clean up TestDBusWrapper
+#endif
}
int UtcDaliDebugRenderingGetVisual1(void)
void dali_property_helper_cleanup(void)
{
test_return_value = TET_PASS;
+#if defined(ELDBUS_ENABLED)
+ DBusWrapper::Install({}); // Clean up TestDBusWrapper
+#endif
}
int UtcDaliPropertyHelperGetStringFromPropertyWithString(void)
void utc_dali_toolkit_internal_svg_loader_cleanup(void)
{
test_return_value = TET_PASS;
+#if defined(ELDBUS_ENABLED)
+ DBusWrapper::Install({}); // Clean up TestDBusWrapper
+#endif
}
namespace
void dali_textselectionpopupinternal_cleanup(void)
{
test_return_value = TET_PASS;
+#if defined(ELDBUS_ENABLED)
+ DBusWrapper::Install({}); // Clean up TestDBusWrapper
+#endif
}
int UtcDaliToolkitTextSelectionPopupIconPropertiesN(void)
void utc_dali_toolkit_texture_manager_cleanup(void)
{
test_return_value = TET_PASS;
+#if defined(ELDBUS_ENABLED)
+ DBusWrapper::Install({}); // Clean up TestDBusWrapper
+#endif
}
namespace
// Get http_proxy from real environment variables
if(std::string(variable) == std::string("http_proxy"))
{
- return (gEnvironmentVariables[variable] = std::getenv("http_proxy")).c_str();
+ auto* httpProxyResult = std::getenv("http_proxy");
+ return (gEnvironmentVariables[variable] = (httpProxyResult ? httpProxyResult : "")).c_str();
}
return nullptr;
}
void SetTestEnvironmentVariable(const char* variable, const char* value)
{
- gEnvironmentVariables[variable] = value;
+ gEnvironmentVariables[variable] = value ? value : "";
}
} // namespace EnvironmentVariable