diff --git a/test_conformance/context/test_context_negative_create.cpp b/test_conformance/context/test_context_negative_create.cpp index ee2633bf05..2949603cb4 100644 --- a/test_conformance/context/test_context_negative_create.cpp +++ b/test_conformance/context/test_context_negative_create.cpp @@ -33,7 +33,7 @@ int test_context_negative_create(cl_device_id device, cl_context context, test_error(err, "clGetPlatformIDs failed"); - num_platforms = std::max(num_platforms, (cl_uint)2); + num_platforms = std::min(num_platforms, (cl_uint)2); std::vector platforms(num_platforms); err = clGetPlatformIDs(num_platforms, platforms.data(), &num_platforms);