Skip to content

Commit

Permalink
Squashed commit of the following:
Browse files Browse the repository at this point in the history
commit b993058
Author: Nick Logozzo <[email protected]>
Date:   Tue Dec 5 23:03:25 2023 -0500

    Update CMakeLists.txt

commit 75cb1e5
Author: Nick Logozzo <[email protected]>
Date:   Tue Dec 5 23:03:24 2023 -0500

    Update networktests.cpp

commit 986ab9e
Author: Nick Logozzo <[email protected]>
Date:   Tue Dec 5 22:54:46 2023 -0500

    All - Better Casting

commit 7cff88f
Author: Nick Logozzo <[email protected]>
Date:   Tue Dec 5 22:49:29 2023 -0500

    Update networkmonitor.cpp

commit 87776c8
Author: Nick Logozzo <[email protected]>
Date:   Tue Dec 5 22:47:59 2023 -0500

    Update CMakeLists.txt

commit da521a8
Author: Nick Logozzo <[email protected]>
Date:   Tue Dec 5 22:43:55 2023 -0500

    Update networkmonitor.cpp

commit 56d1a2c
Author: Nick Logozzo <[email protected]>
Date:   Tue Dec 5 22:42:02 2023 -0500

    Update CMakeLists.txt
  • Loading branch information
nlogozzo committed Dec 6, 2023
1 parent d2f14a2 commit 0886668
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 7 deletions.
5 changes: 2 additions & 3 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,9 @@ if (POLICY CMP0141)
set(CMAKE_MSVC_DEBUG_INFORMATION_FORMAT "$<IF:$<AND:$<C_COMPILER_ID:MSVC>,$<CXX_COMPILER_ID:MSVC>>,$<$<CONFIG:Debug,RelWithDebInfo>:EditAndContinue>,$<$<CONFIG:Debug,RelWithDebInfo>:ProgramDatabase>>")
endif()

project ("libaura" LANGUAGES CXX VERSION 2023.12.0 DESCRIPTION "A cross-platform base for native Nickvision applications.")
include(GNUInstallDirs)

project ("libaura" VERSION 2023.12.0 DESCRIPTION "A cross-platform base for native Nickvision applications.")

#libaura Library Setup
include_directories(${PROJECT_SOURCE_DIR}/include)
add_library (${PROJECT_NAME} SHARED
Expand Down Expand Up @@ -83,7 +82,7 @@ add_executable(${PROJECT_NAME}_test
tests/webtests.cpp)

find_package(GTest REQUIRED)
target_link_libraries(${PROJECT_NAME}_test PRIVATE libaura GTest::gtest_main GTest::gmock_main)
target_link_libraries(${PROJECT_NAME}_test PUBLIC libaura GTest::gtest_main GTest::gmock_main)

include(GoogleTest)
gtest_discover_tests(${PROJECT_NAME}_test)
4 changes: 2 additions & 2 deletions include/aura.h
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,9 @@ namespace Nickvision::Aura
static_assert(std::is_base_of_v<ConfigurationBase, T> == true, "T must derive from ConfigurationBase");
if (!m_configFiles.contains(key))
{
m_configFiles[key] = new T(key);
m_configFiles[key] = static_cast<ConfigurationBase*>(new T(key));
}
return *((T*)m_configFiles[key]);
return *static_cast<T*>(m_configFiles[key]);
}

private:
Expand Down
3 changes: 2 additions & 1 deletion src/network/networkmonitor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
#include <atlbase.h>
#include <netlistmgr.h>
#else
#include <glib.h>
#include <gio/gio.h>
#endif

Expand All @@ -19,7 +20,7 @@ namespace Nickvision::Aura::Network
#else
m_networkChangedHandlerId = g_signal_connect_data(G_OBJECT(g_network_monitor_get_default()), "network-changed", G_CALLBACK((void(*)(GNetworkMonitor*, bool, void*))([](GNetworkMonitor*, bool, void* data)
{
reinterpret_cast<NetworkMonitor*>(data)->checkConnectionState();
static_cast<NetworkMonitor*>(data)->checkConnectionState();
})), this, nullptr, G_CONNECT_DEFAULT);
#endif
}
Expand Down
3 changes: 2 additions & 1 deletion tests/networktests.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,8 @@ TEST(NetworkTests, ConnectedGlobal)

TEST(NetworkTests, DisableNetCheck)
{
putenv("AURA_DISABLE_NETCHECK=true");
std::string disableNetCheck{ "AURA_DISABLE_NETCHECK=true" };
EXPECT_EQ(putenv(disableNetCheck.c_str()), 0);
NetworkMonitor netmon;
netmon.stateChanged() += [](const NetworkStateChangedEventArgs& e)
{
Expand Down

0 comments on commit 0886668

Please sign in to comment.