Battery Status API: add UMA logging for Linux.
[chromium-blink-merge.git] / tools / clang / empty_string / tests / test-expected.cc
blob6762e375eb93137df990b61968d335a28cea30b1
1 // Copyright (c) 2013 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 // Test file for the empty string clang tool.
7 #include <string>
9 // Tests for std::string declarations.
10 void TestDeclarations() {
11 std::string a, b("abc"), c;
14 // Tests for std::string allocated with new.
15 void TestNew() {
16 std::string* a = new std::string, *b = new std::string("abc"),
17 *c = new std::string, *d = new std::string();
20 // Tests for std::string construction in initializer lists.
21 class TestInitializers {
22 public:
23 TestInitializers() {}
24 TestInitializers(bool) {}
25 TestInitializers(double) : b("cat"), c() {}
27 private:
28 std::string a;
29 std::string b;
30 std::string c;
33 // Tests for temporary std::strings.
34 void TestTemporaries(const std::string& reference_argument,
35 const std::string value_argument) {
36 TestTemporaries(std::string(), std::string());
37 TestTemporaries(std::string(), std::string());
40 // Tests for temporary std::wstrings.
41 void TestWideTemporaries(const std::wstring& reference_argument,
42 const std::wstring value_argument) {
43 TestWideTemporaries(std::wstring(), std::wstring());
44 TestWideTemporaries(std::wstring(), std::wstring());