Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(146)

Side by Side Diff: ui/gl/gl_version_info_unittest.cc

Issue 2070313002: Parse GL_VERSION incorrectly when version string is without release_number (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Add unit test case Created 4 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « ui/gl/gl_version_info.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(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 }
OLDNEW
« no previous file with comments | « ui/gl/gl_version_info.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698