Skip to content

Commit

Permalink
Revert "[core / Tests/unit/core] : Fix build 'test_messageException'" (
Browse files Browse the repository at this point in the history
…#1645)

* Revert "[core / Tests/unit/core] : Fix build 'test_messageException' (#1589)"

This reverts commit e1b416e.

* [WINDOWS] Try it to get it building on Windows again :-)

* [CMAKE] Fun with CMake....

* [R5] Cleanup legacy stuff
  • Loading branch information
pwielders authored Jun 16, 2024
1 parent e911ac4 commit 8a3fe02
Show file tree
Hide file tree
Showing 23 changed files with 71 additions and 89 deletions.
5 changes: 5 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,11 @@ project(Thunder
DESCRIPTION "Thunder framework"
HOMEPAGE_URL "https://rdkcentral.github.io/Thunder/")

set(VERSION ${${PROJECT_NAME}_VERSION})
set(VERSION_MAJOR ${${PROJECT_NAME}_VERSION_MAJOR})
set(VERSION_MINOR ${${PROJECT_NAME}_VERSION_MINOR})
set(VERSION_PATCH ${${PROJECT_NAME}_VERSION_PATCH})

string(TIMESTAMP BUILD_TIMESTAMP UTC)

message(STATUS "Setting up ${PROJECT_NAME} v${Thunder_VERSION}")
Expand Down
5 changes: 1 addition & 4 deletions Source/Thunder/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -40,9 +40,6 @@ target_compile_definitions(${TARGET}

target_compile_options (${TARGET} PRIVATE -Wno-psabi)

configure_file("${CMAKE_CURRENT_SOURCE_DIR}/Version.h.in" "${CMAKE_CURRENT_BINARY_DIR}/generated/version/version.h" @ONLY)
message(STATUS "Generated ${CMAKE_CURRENT_BINARY_DIR}/generated/version/version.h")

if (TREE_REFERENCE)
target_compile_definitions(${TARGET}
PRIVATE
Expand Down Expand Up @@ -98,7 +95,7 @@ set_target_properties(${TARGET} PROPERTIES
CXX_STANDARD 11
CXX_STANDARD_REQUIRED YES
FRAMEWORK FALSE
VERSION ${Thunder_VERSION}
VERSION ${VERSION}
)

install(
Expand Down
2 changes: 0 additions & 2 deletions Source/Thunder/Module.h
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,5 @@
#define TREE_REFERENCE engineering_build_for_debug_purpose_only
#endif

#include <version/version.h>

#undef EXTERNAL
#define EXTERNAL
2 changes: 1 addition & 1 deletion Source/Thunder/PluginHost.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -651,7 +651,7 @@ POP_WARNING()
SYSLOG(Logging::Startup, (_T("Process Id: %d"), Core::ProcessInfo().Id()));
SYSLOG(Logging::Startup, (_T("Tree ref: " _T(EXPAND_AND_QUOTE(TREE_REFERENCE)))));
SYSLOG(Logging::Startup, (_T("Build ref: " _T(EXPAND_AND_QUOTE(BUILD_REFERENCE)))));
SYSLOG(Logging::Startup, (_T("Version: %d:%d:%d"), PluginHost::Major, PluginHost::Minor, PluginHost::Minor));
SYSLOG(Logging::Startup, (_T("Version: %d:%d:%d"), Versioning::Major, Versioning::Minor, Versioning::Minor));
if (_config->MessagingCategoriesFile() == false) {
SYSLOG(Logging::Startup, (_T("Messages [INT]: %s"), options.configFile));
}
Expand Down
6 changes: 3 additions & 3 deletions Source/Thunder/PluginServer.h
Original file line number Diff line number Diff line change
Expand Up @@ -4415,9 +4415,9 @@ namespace PluginHost {
}
inline void Metadata(PluginHost::Metadata::Version& data) const
{
data.Major = PluginHost::Major;
data.Minor = PluginHost::Minor;
data.Patch = PluginHost::Patch;
data.Major = Versioning::Major;
data.Minor = Versioning::Minor;
data.Patch = Versioning::Patch;
data.Hash = string(Core::System::ModuleBuildRef());
}
inline void Metadata(Core::JSON::ArrayType<PluginHost::Metadata::Channel>& data) const
Expand Down
2 changes: 1 addition & 1 deletion Source/Thunder/SystemInfo.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -271,7 +271,7 @@ POP_WARNING()

string SystemInfo::Version() const /* override */
{
return (Core::Format(_T("%d.%d.%d"), PluginHost::Major, PluginHost::Minor, PluginHost::Patch));
return (Core::Format(_T("%d.%d.%d"), Versioning::Major, Versioning::Minor, Versioning::Patch));
}

} //namspace Plugin
Expand Down
14 changes: 0 additions & 14 deletions Source/Thunder/Version.h.in

This file was deleted.

4 changes: 2 additions & 2 deletions Source/ThunderPlugin/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -63,12 +63,12 @@ set_target_properties(${TARGET} PROPERTIES
CXX_STANDARD 11
CXX_STANDARD_REQUIRED YES
FRAMEWORK FALSE
SOVERSION ${Thunder_VERSION_MAJOR}
SOVERSION ${VERSION_MAJOR}
)

if(HUMAN_VERSIONED_BINARIES)
set_target_properties(${TARGET} PROPERTIES
VERSION ${Thunder_VERSION}
VERSION ${VERSION}
)
endif()

Expand Down
4 changes: 2 additions & 2 deletions Source/com/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -86,12 +86,12 @@ set_target_properties(${TARGET} PROPERTIES
CXX_STANDARD_REQUIRED YES
FRAMEWORK FALSE
PUBLIC_HEADER "${PUBLIC_HEADERS}" # specify the public headers
SOVERSION ${Thunder_VERSION_MAJOR}
SOVERSION ${VERSION_MAJOR}
)

if(HUMAN_VERSIONED_BINARIES)
set_target_properties(${TARGET} PROPERTIES
VERSION ${Thunder_VERSION}
VERSION ${VERSION}
)
endif()

Expand Down
6 changes: 3 additions & 3 deletions Source/core/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ message(STATUS "Generated ${CMAKE_CURRENT_BINARY_DIR}/generated/core/Version.h")

add_library(${TARGET}
Module.cpp
DoorBell.cpp
DoorBell.cpp
CyclicBuffer.cpp
DataElement.cpp
DataElementFile.cpp
Expand Down Expand Up @@ -230,12 +230,12 @@ set_target_properties(${TARGET} PROPERTIES
CXX_STANDARD_REQUIRED YES
FRAMEWORK FALSE
PUBLIC_HEADER "${PUBLIC_HEADERS}" # specify the public headers
SOVERSION ${Thunder_VERSION_MAJOR}
SOVERSION ${VERSION_MAJOR}
)

if(HUMAN_VERSIONED_BINARIES)
set_target_properties(${TARGET} PROPERTIES
VERSION ${Thunder_VERSION}
VERSION ${VERSION}
)
endif()

Expand Down
4 changes: 2 additions & 2 deletions Source/core/MessageException.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -36,11 +36,11 @@ PUSH_WARNING(DISABLE_WARNING_DEPRECATED_USE)
}
POP_WARNING()

MessageException::~MessageException() noexcept(true)
MessageException::~MessageException() throw()
{
}

const TCHAR* MessageException::Message() const noexcept(true)
const TCHAR* MessageException::Message() const throw()
{
return m_Message.c_str();
}
Expand Down
6 changes: 3 additions & 3 deletions Source/core/MessageException.h
Original file line number Diff line number Diff line change
Expand Up @@ -29,15 +29,15 @@
namespace Thunder {
namespace Core {

class EXTERNAL MessageException : public std::exception {
class MessageException : public std::exception {
private:
MessageException();

public:
MessageException(const string& message, bool inclSysMsg = false) noexcept(true);
MessageException(const string& message, bool inclSysMsg = false) throw();
~MessageException() throw();

const TCHAR* Message() const noexcept(true);
const TCHAR* Message() const throw();

private:
string m_Message; // Exception message
Expand Down
13 changes: 12 additions & 1 deletion Source/core/Version.h.in
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,15 @@

#pragma once

#define THUNDER_VERSION @Thunder_VERSION_MAJOR@
#include <stdint.h>

#define THUNDER_VERSION @VERSION_MAJOR@

namespace Thunder
{
namespace Versioning {
static constexpr uint8_t Major = @VERSION_MAJOR@;
static constexpr uint8_t Minor = @VERSION_MINOR@;
static constexpr uint8_t Patch = @VERSION_PATCH@;
}
}
4 changes: 2 additions & 2 deletions Source/cryptalgo/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -68,12 +68,12 @@ set_target_properties(${TARGET} PROPERTIES
CXX_STANDARD_REQUIRED YES
FRAMEWORK FALSE
PUBLIC_HEADER "${PUBLIC_HEADERS}" # specify the public headers
SOVERSION ${Thunder_VERSION_MAJOR}
SOVERSION ${VERSION_MAJOR}
)

if(HUMAN_VERSIONED_BINARIES)
set_target_properties(${TARGET} PROPERTIES
VERSION ${Thunder_VERSION}
VERSION ${VERSION}
)
endif()

Expand Down
6 changes: 3 additions & 3 deletions Source/extensions/hibernate/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -38,12 +38,12 @@ set(PUBLIC_HEADERS
set_target_properties(${TARGET} PROPERTIES
FRAMEWORK FALSE
PUBLIC_HEADER "${PUBLIC_HEADERS}"
SOVERSION ${Thunder_VERSION_MAJOR}
SOVERSION ${VERSION_MAJOR}
)

if(HUMAN_VERSIONED_BINARIES)
set_target_properties(${TARGET} PROPERTIES
VERSION ${Thunder_VERSION}
VERSION ${VERSION}
)
endif()

Expand All @@ -70,4 +70,4 @@ InstallCMakeConfig(

InstallPackageConfig(
TARGETS ${TARGET}
DESCRIPTION "Enable ease of development for Hibernate support." )
DESCRIPTION "Enable ease of development for Hibernate support." )
4 changes: 2 additions & 2 deletions Source/extensions/processcontainers/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -76,12 +76,12 @@ set_target_properties(${TARGET} PROPERTIES
CXX_STANDARD_REQUIRED YES
FRAMEWORK FALSE
PUBLIC_HEADER "${PUBLIC_HEADERS}"
SOVERSION ${Thunder_VERSION_MAJOR}
SOVERSION ${VERSION_MAJOR}
)

if(HUMAN_VERSIONED_BINARIES)
set_target_properties(${TARGET} PROPERTIES
VERSION ${Thunder_VERSION}
VERSION ${VERSION}
)
endif()

Expand Down
4 changes: 2 additions & 2 deletions Source/extensions/warningreporting/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -44,12 +44,12 @@ set_target_properties(${TARGET} PROPERTIES
CXX_STANDARD_REQUIRED YES
FRAMEWORK FALSE
PUBLIC_HEADER "${PUBLIC_HEADERS}" # specify the public headers
SOVERSION ${Thunder_VERSION_MAJOR}
SOVERSION ${VERSION_MAJOR}
)

if(HUMAN_VERSIONED_BINARIES)
set_target_properties(${TARGET} PROPERTIES
VERSION ${Thunder_VERSION}
VERSION ${VERSION}
)
endif()

Expand Down
4 changes: 2 additions & 2 deletions Source/messaging/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -59,12 +59,12 @@ set_target_properties(${TARGET} PROPERTIES
CXX_STANDARD_REQUIRED YES
FRAMEWORK FALSE
PUBLIC_HEADER "${PUBLIC_HEADERS}" # specify the public headers
SOVERSION ${Thunder_VERSION_MAJOR}
SOVERSION ${VERSION_MAJOR}
)

if(HUMAN_VERSIONED_BINARIES)
set_target_properties(${TARGET} PROPERTIES
VERSION ${Thunder_VERSION}
VERSION ${VERSION}
)
endif()

Expand Down
8 changes: 4 additions & 4 deletions Source/plugins/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -125,25 +125,25 @@ set_target_properties(${TARGET} PROPERTIES
CXX_STANDARD_REQUIRED YES
FRAMEWORK FALSE
PUBLIC_HEADER "${PUBLIC_HEADERS}" # specify the public headers
SOVERSION ${Thunder_VERSION_MAJOR}
SOVERSION ${VERSION_MAJOR}
)

if(HUMAN_VERSIONED_BINARIES)
set_target_properties(${TARGET} PROPERTIES
VERSION ${Thunder_VERSION}
VERSION ${VERSION}
)
endif()

set_target_properties(${TARGET_PROXYSTUBS} PROPERTIES
CXX_STANDARD 11
CXX_STANDARD_REQUIRED YES
FRAMEWORK FALSE
SOVERSION ${Thunder_VERSION_MAJOR}
SOVERSION ${VERSION_MAJOR}
)

if(HUMAN_VERSIONED_BINARIES)
set_target_properties(${TARGET} PROPERTIES
VERSION ${Thunder_VERSION}
VERSION ${VERSION}
)
endif()

Expand Down
20 changes: 0 additions & 20 deletions Source/tracing/tracing.h

This file was deleted.

4 changes: 2 additions & 2 deletions Source/websocket/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -58,12 +58,12 @@ set_target_properties(${TARGET} PROPERTIES
CXX_STANDARD_REQUIRED YES
FRAMEWORK FALSE
PUBLIC_HEADER "${PUBLIC_HEADERS}" # specify the public headers
SOVERSION ${Thunder_VERSION_MAJOR}
SOVERSION ${VERSION_MAJOR}
)

if(HUMAN_VERSIONED_BINARIES)
set_target_properties(${TARGET} PROPERTIES
VERSION ${Thunder_VERSION}
VERSION ${VERSION}
)
endif()

Expand Down
2 changes: 1 addition & 1 deletion Tests/unit/core/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ add_executable(${TEST_RUNNER_NAME}
test_lockablecontainer.cpp
test_measurementtype.cpp
test_memberavailability.cpp
test_messageException.cpp
#test_messageException.cpp
test_networkinfo.cpp
test_nodeid.cpp
test_numbertype.cpp
Expand Down
31 changes: 18 additions & 13 deletions Tests/unit/core/test_messageException.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -27,17 +27,22 @@ using namespace Thunder::Core;

TEST(test_messageException, simple_messageException)
{
const std::string msg = "Testing the message exception.";

// No 'error' concatenated
MessageException exception(msg, false);

EXPECT_STREQ(exception.Message(), msg.c_str());

// 'error' concatenated
MessageException exception1(msg, true);

const string result = msg + ": No such file or directory";

EXPECT_STREQ(exception1.Message(), result.c_str());
std::string msg = "Testing the message exception.";
MessageException exception(msg.c_str(),false);
EXPECT_STREQ(exception.Message(),msg.c_str());

MessageException exception1(msg.c_str(),true);
char buffer[50];
string status = ": File exists";
snprintf(buffer, msg.size()+status.size()+1, "%s%s",msg.c_str(),status.c_str());
#ifdef BUILD_ARM
if (strcmp(exception1.Message(), buffer) != 0) {
#else
if (strcmp(exception1.Message(), buffer) != 0) {
#endif
memset(buffer, 0, sizeof buffer);
status = ": No such file or directory";
snprintf(buffer, msg.size()+status.size()+1, "%s%s",msg.c_str(),status.c_str());
}
EXPECT_STREQ(exception1.Message(),buffer);
}

0 comments on commit 8a3fe02

Please sign in to comment.