File tree Expand file tree Collapse file tree 1 file changed +23
-1
lines changed
Expand file tree Collapse file tree 1 file changed +23
-1
lines changed Original file line number Diff line number Diff line change 11/*
2- * Copyright (c) 2017, Intel Corporation
2+ * Copyright (c) 2017 - 2018 , Intel Corporation
33 *
44 * Permission is hereby granted, free of charge, to any person obtaining a
55 * copy of this software and associated documentation files (the "Software"),
@@ -150,3 +150,25 @@ INSTANTIATE_TEST_CASE_P(
150150 Device_,
151151 GetDeviceInfoSize,
152152 testing::ValuesIn (deviceInfoParams2));
153+
154+ TEST (DeviceInfoTests, givenDefaultDeviceWhenQueriedForDeviceVersionThenProperSizeIsReturned) {
155+ auto device = std::unique_ptr<Device>(DeviceHelper<>::create ());
156+ size_t sizeReturned = 0 ;
157+ auto retVal = device->getDeviceInfo (
158+ CL_DEVICE_VERSION,
159+ 0 ,
160+ nullptr ,
161+ &sizeReturned);
162+
163+ EXPECT_EQ (CL_SUCCESS, retVal);
164+ EXPECT_EQ (16u , sizeReturned);
165+ std::unique_ptr<char []> deviceVersion (new char [sizeReturned]);
166+
167+ retVal = device->getDeviceInfo (
168+ CL_DEVICE_VERSION,
169+ sizeReturned,
170+ deviceVersion.get (),
171+ nullptr );
172+
173+ EXPECT_EQ (CL_SUCCESS, retVal);
174+ }
You can’t perform that action at this time.
0 commit comments