Project

General

Profile

Actions

Optimization #4066

closed

Add a PASS_IF_NULL macro to the FAIL/PASS API

Added by Shivani Bhardwaj about 4 years ago. Updated about 2 years ago.

Status:
Closed
Priority:
Normal
Assignee:
Target version:
Effort:
Difficulty:
Label:
Beginner, C, Outreachy

Description

src/util-unittests.h contains a few macro definitions that are being used in the new tests. There is PASS, PASS_IF for the success paths. Add a `PASS_IF_NULL` macro. Its function should be as the name suggests. It should pass if the value provided to it is NULL.


Related issues 1 (0 open1 closed)

Related to Suricata - Optimization #4795: Remove PASS_IF macro from the FAIL/PASS APIClosedJuliana Fajardini ReichowActions
Actions #1

Updated by Janani Ramjee about 4 years ago

  • Subject changed from Add a FAIL_IF_NULL macro to the FAIL/PASS API to Add a PASS_IF_NULL macro to the FAIL/PASS API
  • Assignee changed from Community Ticket to Janani Ramjee
Actions #2

Updated by Janani Ramjee about 4 years ago

  • Status changed from New to In Review
Actions #3

Updated by Juliana Fajardini Reichow about 3 years ago

Actions #4

Updated by Juliana Fajardini Reichow about 3 years ago

This idea was discontinued after some further discussion (see https://github.com/OISF/suricata/pull/5485).

One of the reasons is that having PASS_IF macros could end up breaking the guideline of having PASS to be the last
thing called in a unit tests (as the PASS_IF macros could end up implicitly calling FAIL, internally).

The other is because it requires reverting the logic of the FAIL calls in order to be written, therefore making the process
more convoluted.

Actions #5

Updated by Juliana Fajardini Reichow about 3 years ago

  • Status changed from In Review to Closed

Commit https://github.com/OISF/suricata/pull/6582/commits/d581fc82b18219d9c5bef8f0e0c0c42545c7b054, merged in https://github.com/OISF/suricata/pull/6582, removed the PASS_IF macro, as per the decision shared in the related issue.

Closing this one, then...

Actions #6

Updated by Victor Julien about 2 years ago

  • Target version set to 7.0.0-beta1
Actions

Also available in: Atom PDF