utc-Dali-BaseHandle.cpp
utc-Dali-CameraActor.cpp
utc-Dali-CircularQueue.cpp
+ utc-Dali-Common.cpp
utc-Dali-ConditionalWait.cpp
utc-Dali-ConnectionTracker.cpp
utc-Dali-Constrainer.cpp
--- /dev/null
+/*
+ * Copyright (c) 2023 Samsung Electronics Co., Ltd.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+#include <dali-test-suite-utils.h>
+
+#include <dali/public-api/common/dali-common.h>
+
+using namespace Dali;
+
+void utc_dali_common_startup(void)
+{
+ test_return_value = TET_UNDEF;
+}
+
+void utc_dali_common_cleanup(void)
+{
+ test_return_value = TET_PASS;
+}
+
+int UtcDaliCommonPrintBackTrace(void)
+{
+ TestApplication application;
+ tet_infoline("Testing Dali::DaliPrintBackTrace");
+
+ try
+ {
+ Dali::DaliPrintBackTrace();
+ tet_result(TET_PASS);
+ }
+ catch(...)
+ {
+ tet_result(TET_FAIL);
+ }
+
+ END_TEST;
+}
/*
- * Copyright (c) 2020 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2023 Samsung Electronics Co., Ltd.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
free(symbols);
}
+DALI_CORE_API void DaliPrintBackTrace()
+{
+ DALI_LOG_ERROR_NOFN("Backtrace:\n");
+
+ void* frameArray[MAX_NUM_STACK_FRAMES];
+ int32_t nSize = backtrace(frameArray, MAX_NUM_STACK_FRAMES);
+ char** symbols = backtrace_symbols(frameArray, nSize);
+ for(int32_t i = 1; i < nSize; i++)
+ {
+ std::string demangled_symbol = Demangle(symbols[i]);
+ DALI_LOG_ERROR_NOFN("[%02d] %s\n", i, demangled_symbol.c_str());
+ }
+ free(symbols);
+}
+
#else // BACKTRACE_ENABLED
DALI_CORE_API DaliException::DaliException(const char* location, const char* condition)
#endif
}
+DALI_CORE_API void DaliPrintBackTrace()
+{
+}
+
#endif // BACKTRACE_ENABLED
DALI_CORE_API void DaliAssertMessage(const char* location, const char* condition)
#define DALI_COMMON_H
/*
- * Copyright (c) 2020 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2023 Samsung Electronics Co., Ltd.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
*/
DALI_CORE_API void DaliAssertMessage(const char* location, const char* condition);
+/**
+ * @brief Print backtrace log if required.
+ * @note Do nothing if ENABLE_BACKTRACE option off.
+ *
+ * @SINCE_2_3.2
+ */
+DALI_CORE_API void DaliPrintBackTrace();
+
/**
* @brief Exception class for Dali Core library - Raised by assertions in codebase.
* @SINCE_1_0.0