| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 #include <stddef.h> |
| 6 #include <stdlib.h> | 7 #include <stdlib.h> |
| 7 | 8 |
| 8 #include <string> | 9 #include <string> |
| 9 | 10 |
| 10 #include "base/basictypes.h" | |
| 11 #include "chrome/installer/mini_installer/mini_string.h" | 11 #include "chrome/installer/mini_installer/mini_string.h" |
| 12 #include "testing/gtest/include/gtest/gtest.h" | 12 #include "testing/gtest/include/gtest/gtest.h" |
| 13 | 13 |
| 14 using mini_installer::StackString; | 14 using mini_installer::StackString; |
| 15 | 15 |
| 16 namespace { | 16 namespace { |
| 17 class MiniInstallerStringTest : public testing::Test { | 17 class MiniInstallerStringTest : public testing::Test { |
| 18 protected: | 18 protected: |
| 19 void SetUp() override {} | 19 void SetUp() override {} |
| 20 void TearDown() override {} | 20 void TearDown() override {} |
| (...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 67 | 67 |
| 68 StackString<MAX_PATH> str; | 68 StackString<MAX_PATH> str; |
| 69 EXPECT_TRUE(str.assign(kTestStringSource)); | 69 EXPECT_TRUE(str.assign(kTestStringSource)); |
| 70 EXPECT_EQ(str.get(), str.findi(kTestStringSource)); | 70 EXPECT_EQ(str.get(), str.findi(kTestStringSource)); |
| 71 EXPECT_EQ(static_cast<const wchar_t*>(NULL), str.findi(kTestStringNotFound)); | 71 EXPECT_EQ(static_cast<const wchar_t*>(NULL), str.findi(kTestStringNotFound)); |
| 72 const wchar_t* found = str.findi(kTestStringFind); | 72 const wchar_t* found = str.findi(kTestStringFind); |
| 73 EXPECT_NE(static_cast<const wchar_t*>(NULL), found); | 73 EXPECT_NE(static_cast<const wchar_t*>(NULL), found); |
| 74 std::wstring check(found, _countof(kTestStringFind) - 1); | 74 std::wstring check(found, _countof(kTestStringFind) - 1); |
| 75 EXPECT_EQ(0, lstrcmpi(check.c_str(), kTestStringFind)); | 75 EXPECT_EQ(0, lstrcmpi(check.c_str(), kTestStringFind)); |
| 76 } | 76 } |
| OLD | NEW |