mirror of
https://github.com/ossrs/srs.git
synced 2025-03-09 15:49:59 +00:00
Log: Use string compare function
This commit is contained in:
parent
6624b8acca
commit
f551ff5ae8
6 changed files with 22 additions and 12 deletions
|
@ -222,14 +222,14 @@ VOID TEST(AppCoroutineTest, Cycle)
|
|||
MockCoroutineHandler ch;
|
||||
SrsSTCoroutine sc("test", &ch, SrsContextId("250"));
|
||||
ch.trd = ≻
|
||||
EXPECT_TRUE(sc.cid().equals(SrsContextId("250")));
|
||||
EXPECT_TRUE(!sc.cid().compare(SrsContextId("250")));
|
||||
|
||||
EXPECT_TRUE(srs_success == sc.start());
|
||||
EXPECT_TRUE(srs_success == sc.pull());
|
||||
|
||||
// After running, the cid in cycle should equal to the thread.
|
||||
srs_cond_timedwait(ch.running, 100 * SRS_UTIME_MILLISECONDS);
|
||||
EXPECT_TRUE(ch.cid.equals(SrsContextId("250")));
|
||||
EXPECT_TRUE(!ch.cid.compare(SrsContextId("250")));
|
||||
}
|
||||
|
||||
if (true) {
|
||||
|
|
|
@ -1383,8 +1383,8 @@ VOID TEST(TCPServerTest, ContextUtility)
|
|||
SrsThreadContext ctx;
|
||||
|
||||
EXPECT_TRUE(ctx.set_id(SrsContextId("100")).empty());
|
||||
EXPECT_TRUE(ctx.set_id(SrsContextId("1000")).equals(SrsContextId("100")));
|
||||
EXPECT_TRUE(ctx.get_id().equals(SrsContextId("1000")));
|
||||
EXPECT_TRUE(!ctx.set_id(SrsContextId("1000")).compare(SrsContextId("100")));
|
||||
EXPECT_TRUE(!ctx.get_id().compare(SrsContextId("1000")));
|
||||
|
||||
ctx.clear_cid();
|
||||
EXPECT_TRUE(ctx.set_id(SrsContextId("100")).empty());
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue