Project

General

Profile

Actions

Optimization #4066

closed
SB JR

Add a PASS_IF_NULL macro to the FAIL/PASS API

Optimization #4066: Add a PASS_IF_NULL macro to the FAIL/PASS API

Added by Shivani Bhardwaj over 5 years ago. Updated over 3 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

JR Updated by Janani Ramjee over 5 years ago Actions #1

  • 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

JR Updated by Janani Ramjee over 5 years ago Actions #2

  • Status changed from New to In Review

JF Updated by Juliana Fajardini Reichow over 4 years ago Actions #3

JF Updated by Juliana Fajardini Reichow over 4 years ago Actions #4

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.

JF Updated by Juliana Fajardini Reichow over 4 years ago Actions #5

  • 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...

VJ Updated by Victor Julien over 3 years ago Actions #6

  • Target version set to 7.0.0-beta1
Actions

Also available in: PDF Atom