SkelCL
SkelCL is a high level multi GPU skeleton library developed at the university of Münster, Germany.
 All Classes Namespaces Files Functions Variables Typedefs Groups
DevicesTests.cpp
1 /*****************************************************************************
2  * Copyright (c) 2011-2012 The SkelCL Team as listed in CREDITS.txt *
3  * http://skelcl.uni-muenster.de *
4  * *
5  * This file is part of SkelCL. *
6  * SkelCL is available under multiple licenses. *
7  * The different licenses are subject to terms and condition as provided *
8  * in the files specifying the license. See "LICENSE.txt" for details *
9  * *
10  *****************************************************************************
11  * *
12  * SkelCL is free software: you can redistribute it and/or modify *
13  * it under the terms of the GNU General Public License as published by *
14  * the Free Software Foundation, either version 3 of the License, or *
15  * (at your option) any later version. See "LICENSE-gpl.txt" for details. *
16  * *
17  * SkelCL is distributed in the hope that it will be useful, *
18  * but WITHOUT ANY WARRANTY; without even the implied warranty of *
19  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
20  * GNU General Public License for more details. *
21  * *
22  *****************************************************************************
23  * *
24  * For non-commercial academic use see the license specified in the file *
25  * "LICENSE-academic.txt". *
26  * *
27  *****************************************************************************
28  * *
29  * If you are interested in other licensing models, including a commercial- *
30  * license, please contact the author at michel.steuwer@uni-muenster.de *
31  * *
32  *****************************************************************************/
33 
37 
38 #include <SkelCL/SkelCL.h>
39 #include <SkelCL/detail/DeviceList.h>
40 
41 #include "Test.h"
44 
45 class DeviceListTest : public ::testing::Test {
46 protected:
47  DeviceListTest() {
48  }
49 
50  ~DeviceListTest() {
51  // tear down
52  }
53 };
54 
55 TEST_F(DeviceListTest, Instance) {
56  skelcl::detail::DeviceList devices;
57  EXPECT_TRUE(devices.empty());
58 }
59 
60 TEST_F(DeviceListTest, DeviceListInitOne) {
61  skelcl::detail::DeviceList devices;
62  devices.init(skelcl::nDevices(1));
63  EXPECT_FALSE(devices.empty());
64  EXPECT_EQ(1, devices.size());
65 }
66 
67 TEST_F(DeviceListTest, DeviceListInit) {
68  skelcl::detail::DeviceList devices;
69  devices.init(skelcl::allDevices());
70  EXPECT_FALSE(devices.empty());
71  EXPECT_LT(0, devices.size()) << "Expected at least one device";
72 }
73 
75 
SKELCL_DLL detail::DeviceProperties allDevices()
Creates a detail::DeviceProperties object representing all devices in the system. This object should ...
Definition: SkelCL.cpp:61
SKELCL_DLL detail::DeviceProperties nDevices(size_t n)
Creates a detail::DeviceProperties object representing n devices. This object should be used as param...
Definition: SkelCL.cpp:66