gpu: nvgpu: unit: add unit_assert helper

Add unit_assert helper to check condition.
In case of failure, the macro reports failed condition as well as
line number, then runs bail out code.

Jira NVGPU-3476

Change-Id: I9971e7fa0337661d46a06dfa05b67a98e3c46eee
Signed-off-by: Thomas Fleury <tfleury@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/2129675
GVS: Gerrit_Virtual_Submit
Reviewed-by: Deepak Nibade <dnibade@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
This commit is contained in:
Thomas Fleury
2019-05-31 13:19:40 -07:00
committed by mobile promotions
parent eb380fcbdb
commit 04cf2f1ba6
2 changed files with 16 additions and 5 deletions

View File

@@ -55,11 +55,7 @@
} while (0)
#endif
struct test_tsg_args {
bool init_done;
struct nvgpu_tsg *tsg;
struct nvgpu_channel *ch;
};
#define assert(cond) unit_assert(cond, goto done)
struct test_tsg_args test_args = {
.init_done = false,