| @@ -5,6 +5,8 @@ VisualStudioVersion = 16.0.30804.86 | |||||
| MinimumVisualStudioVersion = 10.0.40219.1 | MinimumVisualStudioVersion = 10.0.40219.1 | ||||
| Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Alogrithm", "Alogrithm\Alogrithm.vcxproj", "{10672502-40A3-4840-8A25-4F01518FDEBE}" | Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Alogrithm", "Alogrithm\Alogrithm.vcxproj", "{10672502-40A3-4840-8A25-4F01518FDEBE}" | ||||
| EndProject | EndProject | ||||
| Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "UnitTest", "UnitTest\UnitTest.vcxproj", "{BABADA8A-F1CD-4EAA-9392-D0B01F8DF7A4}" | |||||
| EndProject | |||||
| Global | Global | ||||
| GlobalSection(SolutionConfigurationPlatforms) = preSolution | GlobalSection(SolutionConfigurationPlatforms) = preSolution | ||||
| Debug|x64 = Debug|x64 | Debug|x64 = Debug|x64 | ||||
| @@ -21,6 +23,14 @@ Global | |||||
| {10672502-40A3-4840-8A25-4F01518FDEBE}.Release|x64.Build.0 = Release|x64 | {10672502-40A3-4840-8A25-4F01518FDEBE}.Release|x64.Build.0 = Release|x64 | ||||
| {10672502-40A3-4840-8A25-4F01518FDEBE}.Release|x86.ActiveCfg = Release|Win32 | {10672502-40A3-4840-8A25-4F01518FDEBE}.Release|x86.ActiveCfg = Release|Win32 | ||||
| {10672502-40A3-4840-8A25-4F01518FDEBE}.Release|x86.Build.0 = Release|Win32 | {10672502-40A3-4840-8A25-4F01518FDEBE}.Release|x86.Build.0 = Release|Win32 | ||||
| {BABADA8A-F1CD-4EAA-9392-D0B01F8DF7A4}.Debug|x64.ActiveCfg = Debug|x64 | |||||
| {BABADA8A-F1CD-4EAA-9392-D0B01F8DF7A4}.Debug|x64.Build.0 = Debug|x64 | |||||
| {BABADA8A-F1CD-4EAA-9392-D0B01F8DF7A4}.Debug|x86.ActiveCfg = Debug|Win32 | |||||
| {BABADA8A-F1CD-4EAA-9392-D0B01F8DF7A4}.Debug|x86.Build.0 = Debug|Win32 | |||||
| {BABADA8A-F1CD-4EAA-9392-D0B01F8DF7A4}.Release|x64.ActiveCfg = Release|x64 | |||||
| {BABADA8A-F1CD-4EAA-9392-D0B01F8DF7A4}.Release|x64.Build.0 = Release|x64 | |||||
| {BABADA8A-F1CD-4EAA-9392-D0B01F8DF7A4}.Release|x86.ActiveCfg = Release|Win32 | |||||
| {BABADA8A-F1CD-4EAA-9392-D0B01F8DF7A4}.Release|x86.Build.0 = Release|Win32 | |||||
| EndGlobalSection | EndGlobalSection | ||||
| GlobalSection(SolutionProperties) = preSolution | GlobalSection(SolutionProperties) = preSolution | ||||
| HideSolutionNode = FALSE | HideSolutionNode = FALSE | ||||
| @@ -139,10 +139,12 @@ | |||||
| </Link> | </Link> | ||||
| </ItemDefinitionGroup> | </ItemDefinitionGroup> | ||||
| <ItemGroup> | <ItemGroup> | ||||
| <ClCompile Include="src\1_ContainsNearbyDuplicate.cpp" /> | |||||
| <ClCompile Include="src\2_ExcelSheetColumnTitle.cpp" /> | <ClCompile Include="src\2_ExcelSheetColumnTitle.cpp" /> | ||||
| <ClCompile Include="src\main.cpp" /> | <ClCompile Include="src\main.cpp" /> | ||||
| </ItemGroup> | </ItemGroup> | ||||
| <ItemGroup> | <ItemGroup> | ||||
| <ClInclude Include="include\1_ContainsNearbyDuplicate.h" /> | |||||
| <ClInclude Include="include\2_ExcelSheetColumnTitle.h" /> | <ClInclude Include="include\2_ExcelSheetColumnTitle.h" /> | ||||
| </ItemGroup> | </ItemGroup> | ||||
| <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" /> | <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" /> | ||||
| @@ -30,10 +30,16 @@ | |||||
| <ClCompile Include="src\2_ExcelSheetColumnTitle.cpp"> | <ClCompile Include="src\2_ExcelSheetColumnTitle.cpp"> | ||||
| <Filter>源文件\src</Filter> | <Filter>源文件\src</Filter> | ||||
| </ClCompile> | </ClCompile> | ||||
| <ClCompile Include="src\1_ContainsNearbyDuplicate.cpp"> | |||||
| <Filter>源文件\src</Filter> | |||||
| </ClCompile> | |||||
| </ItemGroup> | </ItemGroup> | ||||
| <ItemGroup> | <ItemGroup> | ||||
| <ClInclude Include="include\2_ExcelSheetColumnTitle.h"> | <ClInclude Include="include\2_ExcelSheetColumnTitle.h"> | ||||
| <Filter>头文件\include</Filter> | <Filter>头文件\include</Filter> | ||||
| </ClInclude> | </ClInclude> | ||||
| <ClInclude Include="include\1_ContainsNearbyDuplicate.h"> | |||||
| <Filter>头文件\include</Filter> | |||||
| </ClInclude> | |||||
| </ItemGroup> | </ItemGroup> | ||||
| </Project> | </Project> | ||||
| @@ -10,19 +10,8 @@ namespace UnitTest | |||||
| public: | public: | ||||
| TEST_METHOD(TestMethode1) | |||||
| TEST_METHOD(TestMethode2) | |||||
| { | { | ||||
| char str[50][10] = { 0 };//保存ini文件里 节的名字 | |||||
| int count = CalcCount(50, str);//保存ini文件里 节的个数 | |||||
| bool nReal;//保存运算结果 | |||||
| CString na, nb, nExpect; //b保存不同的键值 | |||||
| for (int j = 0; j < count; j++) | |||||
| { | |||||
| GetPrivateProfileString(str[j], "na", " ", na.GetBuffer(20), 20, FilePath); | |||||
| GetPrivateProfileString(str[j], "nExpect", " ", nExpect.GetBuffer(20), 20, FilePath); | |||||
| nReal = add(_ttoi64(na), _ttoi64(nb)); //_ttoi是CString转为整型 | |||||
| Assert::AreEqual(nReal, _ttoi64(nExpect)); | |||||
| } | |||||
| } | } | ||||
| }; | }; | ||||
| @@ -14,6 +14,7 @@ | |||||
| #include <atlstr.h> | #include <atlstr.h> | ||||
| int CalcCount(int n, char(*str)[10]); | int CalcCount(int n, char(*str)[10]); | ||||
| int* str_device(CString* str, int* value_count); | int* str_device(CString* str, int* value_count); | ||||