mirror of
git://nv-tegra.nvidia.com/linux-nvgpu.git
synced 2025-12-22 17:36:20 +03:00
gpu: nvgpu: add bvec tests for utils
Add boundary value tests for common utils unit. JIRA NVGPU-6395 Change-Id: I4442f339c0238e7ee8a44277ca5f53db9c71f367 Signed-off-by: ajesh <akv@nvidia.com> Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvgpu/+/2542636 (cherry picked from commit 125d73582d57b673b155ada6ce7430401d56dbc3) Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvgpu/+/2548579 Reviewed-by: svc_kernel_abi <svc_kernel_abi@nvidia.com> Reviewed-by: svc-mobile-coverity <svc-mobile-coverity@nvidia.com> Reviewed-by: svc-mobile-misra <svc-mobile-misra@nvidia.com> Reviewed-by: svc-mobile-cert <svc-mobile-cert@nvidia.com> Reviewed-by: Rajesh Devaraj <rdevaraj@nvidia.com> Reviewed-by: Vaibhav Kachore <vkachore@nvidia.com> Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com> GVS: Gerrit_Virtual_Submit Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2020, NVIDIA CORPORATION. All rights reserved.
|
||||
* Copyright (c) 2020-2021, NVIDIA CORPORATION. All rights reserved.
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a
|
||||
* copy of this software and associated documentation files (the "Software"),
|
||||
@@ -76,13 +76,25 @@ int test_memcpy_memcmp(struct unit_module *m, struct gk20a *g, void *args);
|
||||
*
|
||||
* Input: None.
|
||||
*
|
||||
* Equivalence classes:
|
||||
* Variable: radix
|
||||
* - Valid: { 2 - 16 }
|
||||
* - Invalid: { 0, 1, 17 - UINT32_MAX }
|
||||
*
|
||||
* Steps:
|
||||
* - Call nvgpu_strnadd_u32 with invalid radices. Verify 0 is returned.
|
||||
* - Call nvgpu_strnadd_u32 with an insufficient string size for the requested.
|
||||
* number. Verify 0 is returned.
|
||||
* - Call nvgpu_strnadd_u32 with invalid radix 0. Verify 0 is returned.
|
||||
* - Call nvgpu_strnadd_u32 with invalid radix 1. Verify 0 is returned.
|
||||
* - Call nvgpu_strnadd_u32 with invalid radix 17. Verify 0 is returned.
|
||||
* - Call nvgpu_strnadd_u32 with invalid radix 100. Verify 0 is returned.
|
||||
* - Call nvgpu_strnadd_u32 with invalid radix UINT32_MAX. Verify 0 is
|
||||
* returned.
|
||||
* - Call nvgpu_strnadd_u32 with insufficient string sizes. Verify 0 is
|
||||
* returned.
|
||||
* - Call nvgpu_strnadd_u32 with a binary value of 10. Verify returned size
|
||||
* is 4 and the string contains "1010".
|
||||
* - Call nvgpu_strnadd_u32 with a decimal value of 1000. Verify returned size
|
||||
* is 4 and the string contains "1000".
|
||||
* - Call nvgpu_strnadd_u32 with a hexidecimal value of 0xdeadbeef. Verify
|
||||
* - Call nvgpu_strnadd_u32 with a hexadecimal value of 0xdeadbeef. Verify
|
||||
* returned size is 8 and the string contains "deadbeef".
|
||||
*
|
||||
* Output: Returns PASS if expected result is met, FAIL otherwise.
|
||||
|
||||
Reference in New Issue
Block a user