Opened 3 months ago

Closed 3 weeks ago

#31516 closed defect (not a bug)

config refactor: every function table entry should be documented and unit tested

Reported by: teor Owned by: nickm
Priority: Medium Milestone: Tor: 0.4.3.x-final
Component: Core Tor/Tor Version:
Severity: Normal Keywords: network-team-roadmap-august, 042-deferred-20190918
Cc: nickm, teor, gaba Actual Points:
Parent ID: #29211 Points:
Reviewer: Sponsor: Sponsor31-must

Description (last modified by teor)

We've added a lot of function tables, but some of their entries are all NULL, everywhere in the code.

So even if it looks like we have 100% coverage, we're not testing these code paths.

Ideally, we should have non-trivial functions, which do the thing that the function table entry is mean to do.

Edited to add:

Also, function table types should be documented with the same level of detail as regular functions. Each argument should have a type, name?, and description.

Child Tickets

Change History (6)

comment:1 Changed 3 months ago by teor

Sponsor: Sponsor31-must

comment:2 Changed 3 months ago by teor

Description: modified (diff)
Summary: config refactor: every function table entry should be unit testedconfig refactor: every function table entry should be documented and unit tested

comment:3 Changed 2 months ago by nickm

In the current git-master, I think that every config-related function-table point is documented, except for validate_fn_t. I will handle the missing documentation for that as part of #31078. as part of #31627.

Last edited 2 months ago by nickm (previous) (diff)

comment:4 Changed 2 months ago by nickm

In current git-master, I think that every function pointer is called from the unit tests, based on inspection of the coverage. I'll make sure that my future branches test all of our function pointers.

(While I was looking at the coverage, I found some unused APIs, however. I opened #31629 and #31630 to remove them.)

comment:5 Changed 2 months ago by nickm

Keywords: 042-deferred-20190918 added
Milestone: Tor: 0.4.2.x-finalTor: 0.4.3.x-final

Defer numerous 0.4.2 tickets to 0.4.3.

comment:6 Changed 3 weeks ago by nickm

Resolution: not a bug
Status: assignedclosed

Closing, as this is a general requirement going forward, not a task.

Note: See TracTickets for help on using tickets.