History

Fix the decoder init failed case in UT

Haibo Zhu committed 10 years ago

Commit 46f42ec1 parent 25f53a25 files · +63 −28Browse files

Showing the changes to test/api/BaseDecoderTest.cpp (1 of 5 files). Show all

Unified · Split

test/api/BaseDecoderTest.cpp+8−4
@@ -46,10 +46,13 @@ static void ReadFrame (std::ifstream* file, BufferedData* buf) { · 45 unmodified lines
46BaseDecoderTest::BaseDecoderTest()46BaseDecoderTest::BaseDecoderTest()
47 : decoder_ (NULL), decodeStatus_ (OpenFile) {}47 : decoder_ (NULL), decodeStatus_ (OpenFile) {}
48 48
49void BaseDecoderTest::SetUp() {49int32_t BaseDecoderTest::SetUp() {
50 long rv = WelsCreateDecoder (&decoder_);50 long rv = WelsCreateDecoder (&decoder_);
51 ASSERT_EQ (0, rv);51 EXPECT_EQ (0, rv);
52 ASSERT_TRUE (decoder_ != NULL);52 EXPECT_TRUE (decoder_ != NULL);
53 if (decoder_ == NULL) {
54 return rv;
55 }
53 56
54 SDecodingParam decParam;57 SDecodingParam decParam;
55 memset (&decParam, 0, sizeof (SDecodingParam));58 memset (&decParam, 0, sizeof (SDecodingParam));
@@ -58,7 +61,8 @@ void BaseDecoderTest::SetUp() { · 2 unmodified lines
58 decParam.sVideoProperty.eVideoBsType = VIDEO_BITSTREAM_DEFAULT;61 decParam.sVideoProperty.eVideoBsType = VIDEO_BITSTREAM_DEFAULT;
59 62
60 rv = decoder_->Initialize (&decParam);63 rv = decoder_->Initialize (&decParam);
61 ASSERT_EQ (0, rv);64 EXPECT_EQ (0, rv);
65 return (int32_t)rv;
62}66}
63 67
64void BaseDecoderTest::TearDown() {68void BaseDecoderTest::TearDown() {

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t