Return num_value values of the given type. Returns CL_SUCCESS if they compared as equal.
| 828 | // Return num_value values of the given type. |
| 829 | // Returns CL_SUCCESS if they compared as equal. |
| 830 | static int l_compare(const char* test_name, const cl_uchar* expected, |
| 831 | const cl_uchar* received, size_t num_values, |
| 832 | const TypeInfo& ti) |
| 833 | { |
| 834 | // Compare only the valid returned bytes. |
| 835 | for (unsigned value_idx = 0; value_idx < num_values; value_idx++) |
| 836 | { |
| 837 | const cl_uchar* expv = expected + value_idx * ti.get_size(); |
| 838 | const cl_uchar* gotv = received + value_idx * ti.get_size(); |
| 839 | if (memcmp(expv, gotv, ti.get_value_size())) |
| 840 | { |
| 841 | std::string exp_str = ti.as_string(expv); |
| 842 | std::string got_str = ti.as_string(gotv); |
| 843 | log_error( |
| 844 | "Error: %s test for type %s, at index %d: Expected %s got %s\n", |
| 845 | test_name, ti.get_name_c_str(), value_idx, exp_str.c_str(), |
| 846 | got_str.c_str()); |
| 847 | return 1; |
| 848 | } |
| 849 | } |
| 850 | return CL_SUCCESS; |
| 851 | } |
| 852 | |
| 853 | // Copy a target value from src[idx] to dest[idx] |
| 854 | static int l_copy(cl_uchar* dest, unsigned dest_idx, const cl_uchar* src, |
no test coverage detected