Skip to content

Commit

Permalink
Fixed lacking return entry
Browse files Browse the repository at this point in the history
  • Loading branch information
Mikolaj Malecki committed Jan 13, 2025
1 parent 2116963 commit 9852ae1
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
3 changes: 2 additions & 1 deletion srtcore/api.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -237,7 +237,8 @@ int srt::CUDTUnited::startup(bool implicit)
return 1;

if (m_iInstanceCount++ > 0)
return m_iInstanceCount;
// [reinstate in 1.6.0] return m_iInstanceCount;

Check notice

Code scanning / CodeQL

Commented-out code Note

This comment appears to contain commented-out code.
return 1;

if (m_bGCStatus)

Check notice

Code scanning / CodeQL

Commented-out code Note

This comment appears to contain commented-out code.
// [reinstate in 1.6.0] return m_iInstanceCount;
Expand Down
4 changes: 3 additions & 1 deletion test/test_common.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,9 @@ TEST(General, Startup)
EXPECT_EQ(srt::CUDT::uglobal().getInstanceStatus(), std::make_pair(1, true));

// Every next one should return the number of nested instances
EXPECT_EQ(srt_startup(), 2);
// [reinstate in 1.6.0] EXPECT_EQ(srt_startup(), 2);
srt_startup();
EXPECT_EQ(srt::CUDT::uglobal().getInstanceStatus(), std::make_pair(2, true));

// Now let's pair the first instance, should NOT execute
// [reinstate in 1.6.0] EXPECT_EQ(srt_cleanup(), 1);
Expand Down

0 comments on commit 9852ae1

Please sign in to comment.