1b89a7cc2SEnji Cooper // Copyright 2008, Google Inc.
2b89a7cc2SEnji Cooper // All rights reserved.
3b89a7cc2SEnji Cooper //
4b89a7cc2SEnji Cooper // Redistribution and use in source and binary forms, with or without
5b89a7cc2SEnji Cooper // modification, are permitted provided that the following conditions are
6b89a7cc2SEnji Cooper // met:
7b89a7cc2SEnji Cooper //
8b89a7cc2SEnji Cooper //     * Redistributions of source code must retain the above copyright
9b89a7cc2SEnji Cooper // notice, this list of conditions and the following disclaimer.
10b89a7cc2SEnji Cooper //     * Redistributions in binary form must reproduce the above
11b89a7cc2SEnji Cooper // copyright notice, this list of conditions and the following disclaimer
12b89a7cc2SEnji Cooper // in the documentation and/or other materials provided with the
13b89a7cc2SEnji Cooper // distribution.
14b89a7cc2SEnji Cooper //     * Neither the name of Google Inc. nor the names of its
15b89a7cc2SEnji Cooper // contributors may be used to endorse or promote products derived from
16b89a7cc2SEnji Cooper // this software without specific prior written permission.
17b89a7cc2SEnji Cooper //
18b89a7cc2SEnji Cooper // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
19b89a7cc2SEnji Cooper // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
20b89a7cc2SEnji Cooper // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
21b89a7cc2SEnji Cooper // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
22b89a7cc2SEnji Cooper // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
23b89a7cc2SEnji Cooper // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
24b89a7cc2SEnji Cooper // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
25b89a7cc2SEnji Cooper // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
26b89a7cc2SEnji Cooper // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
27b89a7cc2SEnji Cooper // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
28b89a7cc2SEnji Cooper // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
29b89a7cc2SEnji Cooper //
30b89a7cc2SEnji Cooper // gtest_xml_outfile2_test_ writes some xml via TestProperty used by
31b89a7cc2SEnji Cooper // gtest_xml_outfiles_test.py
32b89a7cc2SEnji Cooper 
3328f6c2f2SEnji Cooper #include <atomic>
3428f6c2f2SEnji Cooper 
35b89a7cc2SEnji Cooper #include "gtest/gtest.h"
36b89a7cc2SEnji Cooper 
37b89a7cc2SEnji Cooper class PropertyTwo : public testing::Test {
38b89a7cc2SEnji Cooper  protected:
SetUp()3928f6c2f2SEnji Cooper   void SetUp() override { RecordProperty("SetUpProp", 2); }
TearDown()4028f6c2f2SEnji Cooper   void TearDown() override { RecordProperty("TearDownProp", 2); }
41b89a7cc2SEnji Cooper };
42b89a7cc2SEnji Cooper 
TEST_F(PropertyTwo,TestInt64ConvertibleProperties)4328f6c2f2SEnji Cooper TEST_F(PropertyTwo, TestInt64ConvertibleProperties) {
4428f6c2f2SEnji Cooper   float float_prop = 3.25;
4528f6c2f2SEnji Cooper   RecordProperty("TestFloatProperty", float_prop);
4628f6c2f2SEnji Cooper 
4728f6c2f2SEnji Cooper   double double_prop = 4.75;
4828f6c2f2SEnji Cooper   RecordProperty("TestDoubleProperty", double_prop);
4928f6c2f2SEnji Cooper 
5028f6c2f2SEnji Cooper   // Validate we can write an unsigned size_t as a property
5128f6c2f2SEnji Cooper   size_t size_t_prop = 5;
5228f6c2f2SEnji Cooper   RecordProperty("TestSizetProperty", size_t_prop);
5328f6c2f2SEnji Cooper 
5428f6c2f2SEnji Cooper   bool bool_prop = true;
5528f6c2f2SEnji Cooper   RecordProperty("TestBoolProperty", bool_prop);
5628f6c2f2SEnji Cooper 
5728f6c2f2SEnji Cooper   char char_prop = 'A';
5828f6c2f2SEnji Cooper   RecordProperty("TestCharProperty", char_prop);
5928f6c2f2SEnji Cooper 
6028f6c2f2SEnji Cooper   int16_t int16_prop = 6;
6128f6c2f2SEnji Cooper   RecordProperty("TestInt16Property", int16_prop);
6228f6c2f2SEnji Cooper 
6328f6c2f2SEnji Cooper   int32_t int32_prop = 7;
6428f6c2f2SEnji Cooper   RecordProperty("TestInt32Property", int32_prop);
6528f6c2f2SEnji Cooper 
6628f6c2f2SEnji Cooper   int64_t int64_prop = 8;
6728f6c2f2SEnji Cooper   RecordProperty("TestInt64Property", int64_prop);
6828f6c2f2SEnji Cooper 
6928f6c2f2SEnji Cooper   enum Foo {
7028f6c2f2SEnji Cooper     NINE = 9,
7128f6c2f2SEnji Cooper   };
7228f6c2f2SEnji Cooper   Foo enum_prop = NINE;
7328f6c2f2SEnji Cooper   RecordProperty("TestEnumProperty", enum_prop);
7428f6c2f2SEnji Cooper 
7528f6c2f2SEnji Cooper   std::atomic<int> atomic_int_prop(10);
7628f6c2f2SEnji Cooper   RecordProperty("TestAtomicIntProperty", atomic_int_prop);
77b89a7cc2SEnji Cooper }
78