conventions for `int` return values
Maintainers usually reply within 1 day
Nobody has claimed this yet.
Assessment
- Difficulty
- 5/5
- Estimated time
- Over a week
- Newbie friendliness
- 25/100
- Issue type
- Refactor
- Clarity
- Needs clarification
- Activity status
- Stale
- Tech stack
- cpp
- Domain
- testing-qa
Research direction
Start by examining the CTS test harness and the existing test_error and test_error_fail paths. Map where int returns represent OpenCL error codes versus test statuses, then compare the proposed conventions. Done means the project has selected and consistently applied one documented approach.
Written by the indexing model from the issue text.
Description
Throughout the CTS, many functions return int, but for different purposes. Sometimes, the int is an OpenCL error code. In other places, the int is the test status, such as whether the test passed, failed or was skipped.
It is very difficult to keep the different meanings of the int return value correct, and is is very common to unintentionally return an OpenCL error code instead of a test status. Because both CL_SUCCESS and TEST_PASS both have the value (zero), this mistake does usually does not cause an issue in practice, though there are no guarantees this is the case now or in the future.
Is this something we want to fix? I think this could take one of two forms:
- Embrace that the test status and OpenCL errors can be intermixed and stop trying to differentiate between the two.
- The value zero will always indicate that the test passed, regardless whether it is
CL_SUCCESSorTEST_PASS. - If we switched
TEST_FAILto be a negative value, a negative value could always indicate that the test failed, regardless whether it is an OpenCL error code orTEST_FAIL. - If we switched
TEST_SKIPPED_ITSELFto be a positive value, a positive value coudl always indicate that the test was skipped. - Note, if we did this, we could clean up parts of the harness; for example, we wouldn't need both
test_errorandtest_error_fail.
- The value zero will always indicate that the test passed, regardless whether it is
- Use a strongly typed test status instead, which would make it impossible to mix the two.
- Dominant language
- C++
- Stars
- 234
- Forks
- 240
- Avg merge
- 6d 12h
- Merged PRs (30d)
- 15
Getting set up
- No Dockerfile or Docker Compose file
- No pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from KhronosGroup/OpenCL-CTS
-
cognizant-backlog
Difficulty 2/5 1-3 hours Newbie friendliness 61/100
KhronosGroup/OpenCL-CTS#2882 · 1 comment ·
Maintainers usually reply within 1 day
-
cl_khr_command_buffer: negative_enqueue_inconsistent_device expects CL_INCOMPATIBLE_COMMAND_QUEUE_KHR instead of CL_INVALID_DEVICEPossibly taken @kpet claimed this 11 days ago. Open
Difficulty 1/5 Under an hour Newbie friendliness 82/100
KhronosGroup/OpenCL-CTS#2872 · 1 comment · 1 assignee ·
Maintainers usually reply within 1 day
-
test_compiler: feature macros for cl_ext_float_atomics are not testedPossibly taken @shajder claimed this 10 days ago. Opencognizant-triage
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
KhronosGroup/OpenCL-CTS#2818 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 70/100
KhronosGroup/OpenCL-CTS#2699 · 1 comment ·
Maintainers usually reply within 1 day
-
cleanup/refactoring
Difficulty 2/5 1-3 hours Newbie friendliness 62/100
KhronosGroup/OpenCL-CTS#2057 ·
Maintainers usually reply within 1 day
All issues in KhronosGroup/OpenCL-CTS
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
Maintainers usually reply within 1 day
-
useless statementOpen
Difficulty 1/5 Under an hour Newbie friendliness 86/100
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 74/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 65/100
grizzlypeak3d/DJV#962 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
Maintainers usually reply within 1 day