From: Krzysztof Malysa Date: Mon, 17 Feb 2025 13:42:38 +0000 (+0100) Subject: Remove DPL::Atomic X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=141174f1e1c8924a4712e1e329d243541dbb000b;p=platform%2Fcore%2Ftest%2Fsecurity-tests.git Remove DPL::Atomic Change-Id: I9c7a3afc4cd9ff1cd314b91f5309e0faaea24357 --- diff --git a/src/framework/config.cmake b/src/framework/config.cmake index 374d3233..337ed233 100644 --- a/src/framework/config.cmake +++ b/src/framework/config.cmake @@ -21,7 +21,6 @@ SET(DPL_FRAMEWORK_TEST_SOURCES ${PROJECT_SOURCE_DIR}/src/framework/src/assert.cpp - ${PROJECT_SOURCE_DIR}/src/framework/src/atomic.cpp ${PROJECT_SOURCE_DIR}/src/framework/src/binary_queue.cpp ${PROJECT_SOURCE_DIR}/src/framework/src/colors.cpp ${PROJECT_SOURCE_DIR}/src/framework/src/exception.cpp diff --git a/src/framework/include/dpl/atomic.h b/src/framework/include/dpl/atomic.h deleted file mode 100644 index 50c4a1a4..00000000 --- a/src/framework/include/dpl/atomic.h +++ /dev/null @@ -1,49 +0,0 @@ -/* - * Copyright (c) 2011 Samsung Electronics Co., Ltd All Rights Reserved - * - * 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. - */ -/* - * @file atomic.h - * @author Przemyslaw Dobrowolski (p.dobrowolsk@samsung.com) - * @version 1.0 - * @brief This file is the header file of atomic - */ -#ifndef DPL_ATOMIC_H -#define DPL_ATOMIC_H - -#pragma GCC system_header -#include - -namespace DPL { -class Atomic -{ - public: - typedef gint ValueType; - - private: - volatile ValueType m_value; - - public: - Atomic(ValueType value = static_cast(0)); - - ValueType ExchangeAndAdd(ValueType value); - bool CompareAndExchange(ValueType oldValue, ValueType newValue); - bool operator--(); - void operator++(); - - operator ValueType() const; -}; -} // namespace DPL - -#endif // DPL_ATOMIC_H diff --git a/src/framework/include/dpl/test/test_runner.h b/src/framework/include/dpl/test/test_runner.h index e96d88bd..6f9de4fa 100644 --- a/src/framework/include/dpl/test/test_runner.h +++ b/src/framework/include/dpl/test/test_runner.h @@ -40,7 +40,6 @@ #include #include -#include #include #include #include diff --git a/src/framework/src/atomic.cpp b/src/framework/src/atomic.cpp deleted file mode 100644 index 2f500745..00000000 --- a/src/framework/src/atomic.cpp +++ /dev/null @@ -1,56 +0,0 @@ -/* - * Copyright (c) 2011 Samsung Electronics Co., Ltd All Rights Reserved - * - * 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. - */ -/* - * @file atomic.cpp - * @author Przemyslaw Dobrowolski (p.dobrowolsk@samsung.com) - * @version 1.0 - * @brief This file is the implementation file of atomic - */ -#include -#include - -namespace DPL { -Atomic::Atomic(ValueType value) : - m_value(value) -{} - -Atomic::ValueType Atomic::ExchangeAndAdd(ValueType value) -{ - return g_atomic_int_add(const_cast(&m_value), value); -} - -bool Atomic::CompareAndExchange(ValueType oldValue, ValueType newValue) -{ - return g_atomic_int_compare_and_exchange(const_cast(&m_value), - oldValue, - newValue); -} - -bool Atomic::operator--() -{ - return g_atomic_int_dec_and_test(const_cast(&m_value)) != TRUE; -} - -void Atomic::operator++() -{ - g_atomic_int_inc(const_cast(&m_value)); -} - -Atomic::operator ValueType() const -{ - return g_atomic_int_get(const_cast(&m_value)); -} -} // namespace DPL diff --git a/src/framework/src/test_runner.cpp b/src/framework/src/test_runner.cpp index b1f18616..c3ecbbbc 100644 --- a/src/framework/src/test_runner.cpp +++ b/src/framework/src/test_runner.cpp @@ -37,6 +37,7 @@ #include #include #include +#include #include #include diff --git a/src/yaca/yaca-test-key.cpp b/src/yaca/yaca-test-key.cpp index efb10179..1784852a 100644 --- a/src/yaca/yaca-test-key.cpp +++ b/src/yaca/yaca-test-key.cpp @@ -23,7 +23,8 @@ #include "dpl/test/test_runner.h" -#include +#include +#include #include #include