MCPcopy Create free account
hub / github.com/alibaba/CicadaPlayer / TEST

Function TEST

framework/tests/utils/xmlUnitTest.cpp:18–45  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

16}
17
18TEST(xml, DOMParser)
19{
20 DOMParser parser{};
21 string url = "http://dash.edgesuite.net/dash264/TestCases/1/manifest.mpd";
22 IDataSource *dataSource = dataSourcePrototype::create(url, nullptr);
23 dataSource->Open(0);
24
25 int size = dataSource->Seek(0, SEEK_SIZE);
26 auto *buffer = static_cast<uint8_t *>(malloc(size));
27
28 int len = 0;
29 while (len < size) {
30 int ret = dataSource->Read(buffer + len, size - len);
31 if (ret > 0) {
32 len += ret;
33 } else
34 break;
35 }
36
37 if (len > 0) {
38 bool ret = parser.parse(reinterpret_cast<const char *>(buffer),size);
39 if (ret){
40 parser.print();
41 }
42 }
43 free(buffer);
44 delete dataSource;
45}

Callers

nothing calls this directly

Calls 5

OpenMethod · 0.45
SeekMethod · 0.45
ReadMethod · 0.45
parseMethod · 0.45
printMethod · 0.45

Tested by

no test coverage detected