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

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: Four indent instead of two 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 2016 The Chromium Authors. All rights reserved.
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 <memory>
6
7 #include "testing/gtest/include/gtest/gtest.h"
8 #include "ui/gl/gl_version_info.h"
9
10 namespace gl {
11
12 TEST(GLVersionInfoTest, MajorMinorVersionTest) {
13 const char* version_str[] = {"4.3 (Core Profile) Mesa 11.2.0",
14 "4.5.0 NVIDIA 364.19",
15 "OpenGL ES 2.0 (ANGLE 2.1.0.cd1b12260360)",
16 "2.1 INTEL-10.6.33"};
17 const char* renderer_str[] = {NULL, NULL, NULL, NULL};
18 const char* extensions_str[] = {"extensions", "extensions",
19 "extensions", "extensions"};
20 unsigned expected_major[] = {4, 4, 2, 2};
21 unsigned expected_minor[] = {3, 5, 0, 1};
22 std::unique_ptr<GLVersionInfo> version_info;
23 for (unsigned i = 0; i < arraysize(version_str); i++) {
24 version_info.reset(new GLVersionInfo(version_str[i],
25 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[i]);
31 EXPECT_EQ(minor, expected_minor[i]);
32 }
33 }
34
35 }
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