Skip to content

Commit

Permalink
Release build (#237)
Browse files Browse the repository at this point in the history
* Switch to ASSERT_EQ from assert to prevent release build optimization

* Fix assert

* Cleanup log statements
  • Loading branch information
disa6302 committed Jan 16, 2024
1 parent 099a9f4 commit 792e0db
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 3 deletions.
5 changes: 5 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,11 @@ add_definitions(-DSDK_VERSION=\"${GIT_COMMIT_HASH}\")
add_definitions(-DDETECTED_GIT_HASH)


if(NOT CMAKE_BUILD_TYPE)
message(STATUS "Setting CMAKE_BUILD_TYPE to Release by default")
set(CMAKE_BUILD_TYPE "Release" CACHE STRING "Choose the type of build." FORCE)
endif()

if(BUILD_SHARED_LIBS)
set(LIBTYPE SHARED)
elseif()
Expand Down
2 changes: 1 addition & 1 deletion src/client/src/InputValidator.c
Original file line number Diff line number Diff line change
Expand Up @@ -372,7 +372,7 @@ VOID fixupClientInfo(PClientInfo pClientInfo, PClientInfo pOrigClientInfo)
pClientInfo->offlineBufferAvailabilityTimeout = MAX_BLOCKING_PUT_WAIT;
}

if (pClientInfo->loggerLogLevel == 0 || pClientInfo->loggerLogLevel > LOG_LEVEL_SILENT) {
if (pClientInfo->loggerLogLevel == 0 || pClientInfo->loggerLogLevel > LOG_LEVEL_PROFILE) {
pClientInfo->loggerLogLevel = LOG_LEVEL_WARN;
}

Expand Down
8 changes: 6 additions & 2 deletions tst/client/ClientTestFixture.h
Original file line number Diff line number Diff line change
Expand Up @@ -373,9 +373,11 @@ class ClientTestBase : public ::testing::Test {
void initTestMembers()
{
UINT32 logLevel = 0;
STATUS retStatus = STATUS_SUCCESS;
auto logLevelStr = GETENV("AWS_KVS_LOG_LEVEL");
if (logLevelStr != NULL) {
assert(STRTOUI32(logLevelStr, NULL, 10, &logLevel) == STATUS_SUCCESS);
retStatus = STRTOUI32(logLevelStr, NULL, 10, &logLevel);
ASSERT_EQ(retStatus, STATUS_SUCCESS);
}

// Zero things out
Expand Down Expand Up @@ -924,9 +926,11 @@ class ClientTestBase : public ::testing::Test {
virtual void SetUpWithoutClientCreation()
{
UINT32 logLevel = 0;
STATUS retStatus = STATUS_SUCCESS;
auto logLevelStr = GETENV("AWS_KVS_LOG_LEVEL");
if (logLevelStr != NULL) {
assert(STRTOUI32(logLevelStr, NULL, 10, &logLevel) == STATUS_SUCCESS);
retStatus = STRTOUI32(logLevelStr, NULL, 10, &logLevel);
ASSERT_EQ(retStatus, STATUS_SUCCESS);
SET_LOGGER_LOG_LEVEL(logLevel);
}

Expand Down

0 comments on commit 792e0db

Please sign in to comment.