提交 fca978e3 authored 作者: Iñaki Baz Castillo's avatar Iñaki Baz Castillo

Add more test units.

上级 e646573c
...@@ -33,6 +33,45 @@ tap.test('server.updateSettings() with invalid options must fail', { timeout: 10 ...@@ -33,6 +33,45 @@ tap.test('server.updateSettings() with invalid options must fail', { timeout: 10
t.tearDown(() => server.close()); t.tearDown(() => server.close());
server.updateSettings({ logLevel: 'WRONG_LOG_LEVEL' }) server.updateSettings({ logLevel: 'WRONG_LOG_LEVEL' })
.then(() => t.fail('should not fail')) .then(() => t.fail('should not succeed'))
.catch(() => t.end()); .catch(() => t.end());
});
tap.test('server.updateSettings() in a closed Server must fail', { timeout: 1000 }, (t) =>
{
let server = mediasoup.Server();
server.on('close', () =>
{
server.updateSettings({ logLevel: 'error' })
.then(() => t.fail('should not succeed'))
.catch(() => t.end());
});
server.close();
});
tap.test('server.createRoom() with no options must succeed', { timeout: 1000 }, (t) =>
{
let server = mediasoup.Server();
t.tearDown(() => server.close());
server.createRoom()
.then(() => t.end())
.catch(() => t.fail('should not fail'));
});
tap.test('server.createRoom() in a closed Server must fail', { timeout: 1000 }, (t) =>
{
let server = mediasoup.Server();
server.on('close', () =>
{
server.createRoom()
.then(() => t.fail('should not succeed'))
.catch(() => t.end());
});
server.close();
}); });
...@@ -29,12 +29,6 @@ namespace Channel ...@@ -29,12 +29,6 @@ namespace Channel
MethodId methodId; MethodId methodId;
Json::Value data; Json::Value data;
// TODO: TMP
Json::FastWriter fastWriter;
fastWriter.dropNullPlaceholders();
fastWriter.omitEndingLineFeed();
MS_DEBUG("JSON msg: %s", fastWriter.write(json).c_str());
// Check fields. // Check fields.
if (json["id"].isUInt()) if (json["id"].isUInt())
......
Markdown 格式
0% 或
您添加了 0 人 到此讨论。请谨慎行事。
请先完成此评论的编辑!
请 注册 或者 后发表评论