Project

General

Profile

Bug #4574

Dysfunctional test cases in Face/TestTcpFactory

Added by Alex Afanasyev almost 2 years ago. Updated 10 days ago.

Status:
New
Priority:
Normal
Category:
Faces
Target version:
Start date:
Due date:
% Done:

0%

Estimated time:

Description

CreateFace, UnsupportedCreateFace, and potentially other cases are checking nothing as they are asynchronous and event dispatch wasn't initiated.

History

#1

Updated by Alex Afanasyev almost 2 years ago

https://gerrit.named-data.net/4665 includes my attempt for the fix, but CreateFace is failing and I'm not sure why.

#2

Updated by Davide Pesavento almost 2 years ago

That's actually on purpose. The test is checking the synchronous part of createFace, i.e. the logic and parameter validation inside the createFace function body only. We don't care about testing the connection establishment and the face creation itself, that's TcpChannel's job and should be tested there, not in the factory.

#3

Updated by Alex Afanasyev almost 2 years ago

Hmm. But those tests effectively do nothing at all.. "No assertions performed". At the very least, there should be a comment what exactly those tests are about...

#4

Updated by Davide Pesavento almost 2 years ago

At least for UnsupportedCreateFace, the error callback is invoked synchronously, so the current checks should be performed, unless I'm missing something. I do believe that this is very fragile though, and we'd probably fail to realize if we ever broke something in the code. So I completely agree that these tests should be made more robust.

#5

Updated by Alex Afanasyev almost 2 years ago

  • Assignee changed from Junxiao Shi to Alex Afanasyev
#6

Updated by Davide Pesavento about 1 year ago

  • translation missing: en.field_tag_list set to UnitTests
#7

Updated by Davide Pesavento 10 days ago

  • Target version changed from v0.7 to v0.8

Also available in: Atom PDF