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

Side by Side Diff: chrome/installer/util/wmi_unittest.cc

Issue 1513043002: clang/win: Let remaining chromium_code targets build with -Wextra. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: . Created 5 years 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
OLDNEW
1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include <windows.h> 5 #include <windows.h>
6 6
7 #include "chrome/installer/util/wmi.h" 7 #include "chrome/installer/util/wmi.h"
8 #include "testing/gtest/include/gtest/gtest.h" 8 #include "testing/gtest/include/gtest/gtest.h"
9 9
10 namespace installer { 10 namespace installer {
11 11
12 TEST(WMITest, TestLocalConnectionSecurityBlanket) { 12 TEST(WMITest, TestLocalConnectionSecurityBlanket) {
13 IWbemServices* services = NULL; 13 IWbemServices* services = NULL;
14 EXPECT_TRUE(WMI::CreateLocalConnection(true, &services)); 14 EXPECT_TRUE(WMI::CreateLocalConnection(true, &services));
15 ASSERT_TRUE(NULL != services); 15 ASSERT_TRUE(NULL != services);
16 ULONG refs = services->Release(); 16 ULONG refs = services->Release();
17 EXPECT_EQ(refs, 0); 17 EXPECT_EQ(0u, refs);
18 } 18 }
19 19
20 TEST(WMITest, TestLocalConnectionNoSecurityBlanket) { 20 TEST(WMITest, TestLocalConnectionNoSecurityBlanket) {
21 IWbemServices* services = NULL; 21 IWbemServices* services = NULL;
22 EXPECT_TRUE(WMI::CreateLocalConnection(false, &services)); 22 EXPECT_TRUE(WMI::CreateLocalConnection(false, &services));
23 ASSERT_TRUE(NULL != services); 23 ASSERT_TRUE(NULL != services);
24 ULONG refs = services->Release(); 24 ULONG refs = services->Release();
25 EXPECT_EQ(refs, 0); 25 EXPECT_EQ(0u, refs);
26 } 26 }
27 27
28 TEST(WMITest, TestCreateClassMethod) { 28 TEST(WMITest, TestCreateClassMethod) {
29 IWbemServices* wmi_services = NULL; 29 IWbemServices* wmi_services = NULL;
30 EXPECT_TRUE(WMI::CreateLocalConnection(true, &wmi_services)); 30 EXPECT_TRUE(WMI::CreateLocalConnection(true, &wmi_services));
31 ASSERT_TRUE(NULL != wmi_services); 31 ASSERT_TRUE(NULL != wmi_services);
32 IWbemClassObject* class_method = NULL; 32 IWbemClassObject* class_method = NULL;
33 EXPECT_TRUE(WMI::CreateClassMethodObject(wmi_services, 33 EXPECT_TRUE(WMI::CreateClassMethodObject(wmi_services,
34 L"Win32_ShortcutFile", 34 L"Win32_ShortcutFile",
35 L"Rename", &class_method)); 35 L"Rename", &class_method));
36 ASSERT_TRUE(NULL != class_method); 36 ASSERT_TRUE(NULL != class_method);
37 ULONG refs = class_method->Release(); 37 ULONG refs = class_method->Release();
38 EXPECT_EQ(refs, 0); 38 EXPECT_EQ(0u, refs);
39 refs = wmi_services->Release(); 39 refs = wmi_services->Release();
40 EXPECT_EQ(refs, 0); 40 EXPECT_EQ(0u, refs);
41 } 41 }
42 42
43 // Creates an instance of cmd which executes 'echo' and exits immediately. 43 // Creates an instance of cmd which executes 'echo' and exits immediately.
44 TEST(WMITest, TestLaunchProcess) { 44 TEST(WMITest, TestLaunchProcess) {
45 int pid = 0; 45 int pid = 0;
46 bool result = WMIProcess::Launch(L"cmd.exe /c echo excelent!", &pid); 46 bool result = WMIProcess::Launch(L"cmd.exe /c echo excelent!", &pid);
47 EXPECT_TRUE(result); 47 EXPECT_TRUE(result);
48 EXPECT_GT(pid, 0); 48 EXPECT_GT(pid, 0);
49 } 49 }
50 50
51 } // namespace installer 51 } // namespace installer
OLDNEW
« no previous file with comments | « chrome/installer/util/shell_util_unittest.cc ('k') | chrome/utility/importer/edge_database_reader_unittest_win.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698