Skip to content

Commit cfa00ae

Browse files
committed
测试
1 parent 21c029e commit cfa00ae

File tree

5 files changed

+201
-0
lines changed

5 files changed

+201
-0
lines changed
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
2+
Microsoft Visual Studio Solution File, Format Version 12.00
3+
# Visual Studio Version 17
4+
VisualStudioVersion = 17.5.33516.290
5+
MinimumVisualStudioVersion = 10.0.40219.1
6+
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "check-if-it-is-a-good-array", "check-if-it-is-a-good-array.vcxproj", "{88D6358F-C6E2-4F0B-93C2-F81151D6CDF2}"
7+
EndProject
8+
Global
9+
GlobalSection(SolutionConfigurationPlatforms) = preSolution
10+
Debug|x64 = Debug|x64
11+
Debug|x86 = Debug|x86
12+
Release|x64 = Release|x64
13+
Release|x86 = Release|x86
14+
EndGlobalSection
15+
GlobalSection(ProjectConfigurationPlatforms) = postSolution
16+
{88D6358F-C6E2-4F0B-93C2-F81151D6CDF2}.Debug|x64.ActiveCfg = Debug|x64
17+
{88D6358F-C6E2-4F0B-93C2-F81151D6CDF2}.Debug|x64.Build.0 = Debug|x64
18+
{88D6358F-C6E2-4F0B-93C2-F81151D6CDF2}.Debug|x86.ActiveCfg = Debug|Win32
19+
{88D6358F-C6E2-4F0B-93C2-F81151D6CDF2}.Debug|x86.Build.0 = Debug|Win32
20+
{88D6358F-C6E2-4F0B-93C2-F81151D6CDF2}.Release|x64.ActiveCfg = Release|x64
21+
{88D6358F-C6E2-4F0B-93C2-F81151D6CDF2}.Release|x64.Build.0 = Release|x64
22+
{88D6358F-C6E2-4F0B-93C2-F81151D6CDF2}.Release|x86.ActiveCfg = Release|Win32
23+
{88D6358F-C6E2-4F0B-93C2-F81151D6CDF2}.Release|x86.Build.0 = Release|Win32
24+
EndGlobalSection
25+
GlobalSection(SolutionProperties) = preSolution
26+
HideSolutionNode = FALSE
27+
EndGlobalSection
28+
GlobalSection(ExtensibilityGlobals) = postSolution
29+
SolutionGuid = {933B2A1C-B717-4150-84D7-5FEFCCB8F2DE}
30+
EndGlobalSection
31+
EndGlobal
Lines changed: 109 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,109 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
3+
<ItemGroup Label="ProjectConfigurations">
4+
<ProjectConfiguration Include="Debug|Win32">
5+
<Configuration>Debug</Configuration>
6+
<Platform>Win32</Platform>
7+
</ProjectConfiguration>
8+
<ProjectConfiguration Include="Release|Win32">
9+
<Configuration>Release</Configuration>
10+
<Platform>Win32</Platform>
11+
</ProjectConfiguration>
12+
<ProjectConfiguration Include="Debug|x64">
13+
<Configuration>Debug</Configuration>
14+
<Platform>x64</Platform>
15+
</ProjectConfiguration>
16+
<ProjectConfiguration Include="Release|x64">
17+
<Configuration>Release</Configuration>
18+
<Platform>x64</Platform>
19+
</ProjectConfiguration>
20+
</ItemGroup>
21+
<PropertyGroup Label="Globals">
22+
<VCProjectVersion>17.0</VCProjectVersion>
23+
<ProjectGuid>{88D6358F-C6E2-4F0B-93C2-F81151D6CDF2}</ProjectGuid>
24+
<Keyword>Win32Proj</Keyword>
25+
</PropertyGroup>
26+
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
27+
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
28+
<ConfigurationType>Application</ConfigurationType>
29+
<UseDebugLibraries>true</UseDebugLibraries>
30+
<PlatformToolset>v143</PlatformToolset>
31+
</PropertyGroup>
32+
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
33+
<ConfigurationType>Application</ConfigurationType>
34+
<UseDebugLibraries>false</UseDebugLibraries>
35+
<PlatformToolset>v143</PlatformToolset>
36+
</PropertyGroup>
37+
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
38+
<ConfigurationType>Application</ConfigurationType>
39+
<UseDebugLibraries>true</UseDebugLibraries>
40+
<PlatformToolset>v143</PlatformToolset>
41+
</PropertyGroup>
42+
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
43+
<ConfigurationType>Application</ConfigurationType>
44+
<UseDebugLibraries>false</UseDebugLibraries>
45+
<PlatformToolset>v143</PlatformToolset>
46+
</PropertyGroup>
47+
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
48+
<ImportGroup Label="ExtensionSettings">
49+
</ImportGroup>
50+
<ImportGroup Label="Shared">
51+
</ImportGroup>
52+
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
53+
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
54+
</ImportGroup>
55+
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
56+
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
57+
</ImportGroup>
58+
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
59+
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
60+
</ImportGroup>
61+
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
62+
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
63+
</ImportGroup>
64+
<PropertyGroup Label="UserMacros" />
65+
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
66+
<LinkIncremental>true</LinkIncremental>
67+
</PropertyGroup>
68+
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
69+
<LinkIncremental>true</LinkIncremental>
70+
</PropertyGroup>
71+
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
72+
<ClCompile>
73+
<PreprocessorDefinitions>WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
74+
<RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>
75+
<WarningLevel>Level3</WarningLevel>
76+
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
77+
<Optimization>Disabled</Optimization>
78+
</ClCompile>
79+
<Link>
80+
<TargetMachine>MachineX86</TargetMachine>
81+
<GenerateDebugInformation>true</GenerateDebugInformation>
82+
<SubSystem>Console</SubSystem>
83+
</Link>
84+
</ItemDefinitionGroup>
85+
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
86+
<ClCompile>
87+
<PreprocessorDefinitions>WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
88+
<RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
89+
<WarningLevel>Level3</WarningLevel>
90+
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
91+
</ClCompile>
92+
<Link>
93+
<TargetMachine>MachineX86</TargetMachine>
94+
<GenerateDebugInformation>true</GenerateDebugInformation>
95+
<SubSystem>Console</SubSystem>
96+
<EnableCOMDATFolding>true</EnableCOMDATFolding>
97+
<OptimizeReferences>true</OptimizeReferences>
98+
</Link>
99+
</ItemDefinitionGroup>
100+
<ItemGroup>
101+
<ClCompile Include="test.cpp" />
102+
</ItemGroup>
103+
<ItemGroup>
104+
<ClInclude Include="index.hpp" />
105+
</ItemGroup>
106+
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
107+
<ImportGroup Label="ExtensionTargets">
108+
</ImportGroup>
109+
</Project>
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
3+
<ItemGroup>
4+
<Filter Include="Source Files">
5+
<UniqueIdentifier>{4FC737F1-C7A5-4376-A066-2A32D752A2FF}</UniqueIdentifier>
6+
<Extensions>cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx</Extensions>
7+
</Filter>
8+
<Filter Include="Header Files">
9+
<UniqueIdentifier>{93995380-89BD-4b04-88EB-625FBE52EBFB}</UniqueIdentifier>
10+
<Extensions>h;hh;hpp;hxx;hm;inl;inc;xsd</Extensions>
11+
</Filter>
12+
<Filter Include="Resource Files">
13+
<UniqueIdentifier>{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}</UniqueIdentifier>
14+
<Extensions>rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav</Extensions>
15+
</Filter>
16+
</ItemGroup>
17+
<ItemGroup>
18+
<ClCompile Include="test.cpp">
19+
<Filter>Source Files</Filter>
20+
</ClCompile>
21+
</ItemGroup>
22+
<ItemGroup>
23+
<ClInclude Include="index.hpp">
24+
<Filter>Header Files</Filter>
25+
</ClInclude>
26+
</ItemGroup>
27+
</Project>
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<Project ToolsVersion="Current" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
3+
<PropertyGroup />
4+
</Project>

check-if-it-is-a-good-array/test.cpp

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,31 @@
11
// +build ignore
2+
3+
// gtest_sum.cpp
4+
#include "index.hpp"
5+
#include <gtest/gtest.h>
6+
#include <iostream>
7+
// int sum(int a, int b)
8+
//{
9+
//// return a + b;
10+
//}
11+
using namespace std;
12+
13+
TEST(check_if_it_is_a_good_array, test1)
14+
{
15+
16+
auto nums = vector<int> { 12, 5, 7, 23 };
17+
18+
auto output = true;
19+
// EXPECT_EQ(5, sum(2, 3)); // 求合2+3=5
20+
// EXPECT_NE(3, sum(3, 4)); // 求合3+4 != 3
21+
EXPECT_EQ(output, Solution().isGoodArray(nums));
22+
};
23+
24+
// 如果在此处不写main函数,那么在链接库的时候还需要链接-lgtest_main, 否则只需链接-lgtest即可。
25+
// #if 0
26+
int main(int argc, char** argv)
27+
{
28+
testing::InitGoogleTest(&argc, argv);
29+
return RUN_ALL_TESTS();
30+
}
31+
// #endif

0 commit comments

Comments
 (0)