OLD | NEW |
---|---|
(Empty) | |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | |
Zhenyao Mo
2016/06/20 16:20:15
nit: 2016
xinghua.cao
2016/06/21 10:06:31
Done.
| |
2 // Use of this source code is governed by a BSD-style license that can be | |
3 // found in the LICENSE file. | |
4 | |
5 #include "testing/gtest/include/gtest/gtest.h" | |
6 #include "ui/gl/gl_version_info.h" | |
7 | |
8 namespace gl { | |
9 | |
10 class GLVersionInfoTest : public testing::Test { | |
Zhenyao Mo
2016/06/20 16:20:15
You don't have to declare this class if it's doing
xinghua.cao
2016/06/21 10:06:31
Done.
| |
11 | |
12 }; | |
13 | |
14 TEST_F(GLVersionInfoTest, MajorMinorVersionTest) { | |
15 const char* version_str[] = {"4.3 (Core Profile) Mesa 11.2.0", | |
16 "4.5.0 NVIDIA 364.19", | |
Zhenyao Mo
2016/06/20 16:20:15
nit: 4 space only indent.
xinghua.cao
2016/06/21 10:06:31
Done.
| |
17 "OpenGL ES 2.0 (ANGLE 2.1.0.cd1b12260360)", | |
18 "2.1 INTEL-10.6.33"}; | |
19 const char* renderer_str[] = {NULL, NULL, NULL, NULL}; | |
20 const char* extensions_str[] = {"extensions", "extensions", | |
21 "extensions", "extensions"}; | |
22 unsigned expected_major_minor[] = {4, 3, 4, 5, 2, 0, 2, 1}; | |
Zhenyao Mo
2016/06/20 16:20:15
Maybe just split into expected_major and expected_
xinghua.cao
2016/06/21 10:06:31
Done.
| |
23 for (unsigned i = 0; i < arraysize(version_str); i++) { | |
24 struct GLVersionInfo* version_info = | |
Zhenyao Mo
2016/06/20 16:20:15
use scoped_ptr
xinghua.cao
2016/06/21 10:06:31
I am not sure where "scoped_ptr" is declared and d
| |
25 new GLVersionInfo(version_str[i], renderer_str[i], extensions_str[i]); | |
26 unsigned major, minor; | |
27 bool is_es, is_es2, is_es3; | |
28 version_info->ParseVersionString(version_str[i], &major, &minor, | |
29 &is_es, &is_es2, &is_es3); | |
30 EXPECT_EQ(major, expected_major_minor[2 * i]); | |
31 EXPECT_EQ(minor, expected_major_minor[2 * i + 1]); | |
32 delete version_info; | |
33 version_info = NULL; | |
34 } | |
35 } | |
36 | |
37 } | |
OLD | NEW |