Skip to content

Commit

Permalink
fix: linting, debug flag for tests
Browse files Browse the repository at this point in the history
  • Loading branch information
lee.fordyce committed Jun 13, 2024
1 parent 1c879a2 commit 1171416
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 4 deletions.
1 change: 0 additions & 1 deletion include/packager/live_packager_export.h
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,6 @@ typedef enum LogSeverity {
FATAL = 3,
} LogSeverity_t;


/// Enable general logging
void lp_initializeLog(LogSeverity_t sev);
/// Capture detailed logging messages
Expand Down
5 changes: 5 additions & 0 deletions packager/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -220,6 +220,11 @@ target_link_libraries(packager_test

# Disabled by default, otherwise build live packager unit tests if BUILD_LIVE_TEST is on.
if(BUILD_LIVE_TEST AND NOT MSVC)
set(IS_DEBUG_BUILD CMAKE_BUILD_TYPE STREQUAL "Debug")
# Indication to the code that this is a debug build
if (${IS_DEBUG_BUILD})
add_compile_definitions(__DEBUG__)
endif ()
add_executable(live_packager_test
live_packager_test.cc
)
Expand Down
15 changes: 12 additions & 3 deletions packager/live_packager_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1562,11 +1562,20 @@ TEST(LivePackagerLoggingTest, InvalidDecryptKeyID) {
SegmentBuffer out;
ASSERT_NE(Status::OK, live_packager.Package(init_seg, media_seg, out));

#ifdef __DEBUG__
const std::vector<std::string> expected_errors = {
"(ERROR): Error retrieving decryption key: 14 (INTERNAL_ERROR): Key for key_id=00000000621f2afe7ab2c868d5fd2e2e was not found.",
"(ERROR): Cannot decrypt samples.",
"(ERROR): Error while parsing MP4",
"(ERROR): Error retrieving decryption key: 14 (INTERNAL_ERROR): Key for "
"key_id=00000000621f2afe7ab2c868d5fd2e2e was not found.",
"(ERROR): Cannot decrypt samples.",
"(ERROR): Error while parsing MP4",
};
#else
const std::vector<std::string> expected_errors = {
"(ERROR): Error retrieving decryption key: 14 (INTERNAL_ERROR): Key for "
"key_id=00000000621f2afe7ab2c868d5fd2e2e was not found.",
"(ERROR): Cannot decrypt samples.",
};
#endif

int num_errors = 0;
const auto messages = lp_getErrorMessages(&num_errors);
Expand Down

0 comments on commit 1171416

Please sign in to comment.