mirror of
https://github.com/ossrs/srs.git
synced 2025-02-13 03:41:55 +00:00
Cover AMF0 codec. 3.0.61
This commit is contained in:
parent
9d1249e256
commit
ebe8fa44e5
1 changed files with 24 additions and 0 deletions
|
@ -182,6 +182,10 @@ VOID TEST(ProtocolAMF0Test, InterfacesString)
|
|||
b.skip(-1 * b.pos());
|
||||
HELPER_EXPECT_SUCCESS(pp->read(&b));
|
||||
EXPECT_TRUE(string("hello") == pp->to_str());
|
||||
|
||||
// For copy.
|
||||
SrsAmf0Any* cp = p->copy();
|
||||
EXPECT_TRUE(string("hello") == cp->to_str());
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -229,6 +233,10 @@ VOID TEST(ProtocolAMF0Test, InterfacesBoolean)
|
|||
b.skip(-1 * b.pos());
|
||||
HELPER_EXPECT_SUCCESS(pp->read(&b));
|
||||
EXPECT_FALSE(p->to_boolean());
|
||||
|
||||
// For copy.
|
||||
SrsAmf0Any* cp = p->copy();
|
||||
EXPECT_FALSE(cp->to_boolean());
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -284,6 +292,10 @@ VOID TEST(ProtocolAMF0Test, InterfacesNumber)
|
|||
b.skip(-1 * b.pos());
|
||||
HELPER_EXPECT_SUCCESS(pp->read(&b));
|
||||
EXPECT_TRUE(100.1 == p->to_number());
|
||||
|
||||
// For copy.
|
||||
SrsAmf0Any* cp = p->copy();
|
||||
EXPECT_TRUE(100.1 == cp->to_number());
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -460,6 +472,10 @@ VOID TEST(ProtocolAMF0Test, InterfacesObject)
|
|||
b.skip(-1 * b.pos());
|
||||
HELPER_EXPECT_SUCCESS(pp->read(&b));
|
||||
EXPECT_TRUE(NULL != pp->to_object());
|
||||
|
||||
// For copy.
|
||||
SrsAmf0Any* cp = p->copy();
|
||||
EXPECT_TRUE(NULL != cp->to_object());
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -631,6 +647,10 @@ VOID TEST(ProtocolAMF0Test, InterfacesEcmaArray)
|
|||
b.skip(-1 * b.pos());
|
||||
HELPER_EXPECT_SUCCESS(pp->read(&b));
|
||||
EXPECT_TRUE(NULL != pp->to_ecma_array());
|
||||
|
||||
// For copy.
|
||||
SrsAmf0Any* cp = p->copy();
|
||||
EXPECT_TRUE(NULL != cp->to_ecma_array());
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -673,6 +693,10 @@ VOID TEST(ProtocolAMF0Test, InterfacesStrictArray)
|
|||
b.skip(-1 * b.pos());
|
||||
HELPER_EXPECT_SUCCESS(pp->read(&b));
|
||||
EXPECT_TRUE(NULL != pp->to_strict_array());
|
||||
|
||||
// For copy.
|
||||
SrsAmf0Any* cp = p->copy();
|
||||
EXPECT_TRUE(NULL != cp->to_strict_array());
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue