diff --git a/mul/C/.vs/C/v16/.suo b/mul/C/.vs/C/v16/.suo
new file mode 100644
index 0000000..74699cd
Binary files /dev/null and b/mul/C/.vs/C/v16/.suo differ
diff --git a/mul/C/C.sln b/mul/C/C.sln
new file mode 100644
index 0000000..3dc2ad4
--- /dev/null
+++ b/mul/C/C.sln
@@ -0,0 +1,41 @@
+
+Microsoft Visual Studio Solution File, Format Version 12.00
+# Visual Studio Version 16
+VisualStudioVersion = 16.0.30804.86
+MinimumVisualStudioVersion = 10.0.40219.1
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "C", "C\C.vcxproj", "{00D1AA82-D340-4FF6-86FF-FFA68354D442}"
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "UnitTest1", "UnitTest1\UnitTest1.vcxproj", "{888C6BC4-668C-4C89-97CE-8108E4583F92}"
+EndProject
+Global
+ GlobalSection(SolutionConfigurationPlatforms) = preSolution
+ Debug|x64 = Debug|x64
+ Debug|x86 = Debug|x86
+ Release|x64 = Release|x64
+ Release|x86 = Release|x86
+ EndGlobalSection
+ GlobalSection(ProjectConfigurationPlatforms) = postSolution
+ {00D1AA82-D340-4FF6-86FF-FFA68354D442}.Debug|x64.ActiveCfg = Debug|x64
+ {00D1AA82-D340-4FF6-86FF-FFA68354D442}.Debug|x64.Build.0 = Debug|x64
+ {00D1AA82-D340-4FF6-86FF-FFA68354D442}.Debug|x86.ActiveCfg = Debug|Win32
+ {00D1AA82-D340-4FF6-86FF-FFA68354D442}.Debug|x86.Build.0 = Debug|Win32
+ {00D1AA82-D340-4FF6-86FF-FFA68354D442}.Release|x64.ActiveCfg = Release|x64
+ {00D1AA82-D340-4FF6-86FF-FFA68354D442}.Release|x64.Build.0 = Release|x64
+ {00D1AA82-D340-4FF6-86FF-FFA68354D442}.Release|x86.ActiveCfg = Release|Win32
+ {00D1AA82-D340-4FF6-86FF-FFA68354D442}.Release|x86.Build.0 = Release|Win32
+ {888C6BC4-668C-4C89-97CE-8108E4583F92}.Debug|x64.ActiveCfg = Debug|x64
+ {888C6BC4-668C-4C89-97CE-8108E4583F92}.Debug|x64.Build.0 = Debug|x64
+ {888C6BC4-668C-4C89-97CE-8108E4583F92}.Debug|x86.ActiveCfg = Debug|Win32
+ {888C6BC4-668C-4C89-97CE-8108E4583F92}.Debug|x86.Build.0 = Debug|Win32
+ {888C6BC4-668C-4C89-97CE-8108E4583F92}.Release|x64.ActiveCfg = Release|x64
+ {888C6BC4-668C-4C89-97CE-8108E4583F92}.Release|x64.Build.0 = Release|x64
+ {888C6BC4-668C-4C89-97CE-8108E4583F92}.Release|x86.ActiveCfg = Release|Win32
+ {888C6BC4-668C-4C89-97CE-8108E4583F92}.Release|x86.Build.0 = Release|Win32
+ EndGlobalSection
+ GlobalSection(SolutionProperties) = preSolution
+ HideSolutionNode = FALSE
+ EndGlobalSection
+ GlobalSection(ExtensibilityGlobals) = postSolution
+ SolutionGuid = {3DF6E949-2010-47F5-9C2B-9B17FE0C93F3}
+ EndGlobalSection
+EndGlobal
diff --git a/mul/C/C/C.vcxproj b/mul/C/C/C.vcxproj
new file mode 100644
index 0000000..5858a0f
--- /dev/null
+++ b/mul/C/C/C.vcxproj
@@ -0,0 +1,157 @@
+
+
+
+
+ Debug
+ Win32
+
+
+ Release
+ Win32
+
+
+ Debug
+ x64
+
+
+ Release
+ x64
+
+
+
+ 16.0
+ Win32Proj
+ {00d1aa82-d340-4ff6-86ff-ffa68354d442}
+ C
+ 10.0
+
+
+
+ DynamicLibrary
+ true
+ v142
+ Unicode
+
+
+ Application
+ false
+ v142
+ true
+ Unicode
+
+
+ Application
+ true
+ v142
+ Unicode
+
+
+ Application
+ false
+ v142
+ true
+ Unicode
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ true
+
+
+ false
+
+
+ true
+
+
+ false
+
+
+
+ Level3
+ true
+ WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions)
+ true
+
+
+ Console
+ true
+ Source.def
+
+
+
+
+ Level3
+ true
+ true
+ true
+ WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions)
+ true
+
+
+ Console
+ true
+ true
+ true
+ Source.def
+
+
+
+
+ Level3
+ true
+ _DEBUG;_CONSOLE;%(PreprocessorDefinitions)
+ true
+
+
+ Console
+ true
+ Source.def
+
+
+
+
+ Level3
+ true
+ true
+ true
+ NDEBUG;_CONSOLE;%(PreprocessorDefinitions)
+ true
+
+
+ Console
+ true
+ true
+ true
+ Source.def
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/mul/C/C/Source.def b/mul/C/C/Source.def
new file mode 100644
index 0000000..3387fa3
--- /dev/null
+++ b/mul/C/C/Source.def
@@ -0,0 +1,3 @@
+LIBRARY "Source"
+EXPORTS
+mul @1
diff --git a/mul/C/C/mul.cpp b/mul/C/C/mul.cpp
new file mode 100644
index 0000000..e027003
--- /dev/null
+++ b/mul/C/C/mul.cpp
@@ -0,0 +1,11 @@
+
+#include "mul.h"
+#include
+long long _stdcall mul(int x, int y)
+{
+ long long m = (long long)x;
+ long long n = (long long)y;
+ long long s = m * n;
+ printf("%lld * %lld = %lld\n",m,n,s);
+ return s;
+}
\ No newline at end of file
diff --git a/mul/C/C/mul.h b/mul/C/C/mul.h
new file mode 100644
index 0000000..a23363e
--- /dev/null
+++ b/mul/C/C/mul.h
@@ -0,0 +1,2 @@
+#pragma once
+long long _stdcall mul(int x, int y);//ʱ̫ΪɶҪ_stdcallDzӵõʱ쳣
diff --git a/mul/C/UnitTest1/UnitTest1.cpp b/mul/C/UnitTest1/UnitTest1.cpp
new file mode 100644
index 0000000..0385bcf
--- /dev/null
+++ b/mul/C/UnitTest1/UnitTest1.cpp
@@ -0,0 +1,36 @@
+#include "pch.h"
+#include "CppUnitTest.h"
+#include "../C/mul.h"
+#include
+#include
+
+#define FilePath "..//ex1.ini"
+using namespace Microsoft::VisualStudio::CppUnitTestFramework;
+
+namespace UnitTest1
+{
+ TEST_CLASS(UnitTest1)
+ {
+ public:
+
+ int j = 0;
+ char str[50][10] = { 0 };//iniļ ڵ
+ int count = CalcCount(50, str);//iniļ ڵĸ
+ unsigned short i;
+ TEST_METHOD(TestMethode1)
+ {
+ int nReal;//
+ CString na, nb, nExpect; //b治ͬļֵ
+ for (j = 0; j < count; j++)
+ {
+ GetPrivateProfileString(str[j], "na", " ", na.GetBuffer(20), 20, FilePath);
+ GetPrivateProfileString(str[j], "nb", " ", nb.GetBuffer(20), 20, FilePath);
+ GetPrivateProfileString(str[j], "nExpect", " ", nExpect.GetBuffer(20), 20, FilePath);
+ nReal = mul(_ttoi(na), _ttoi(nb)); //_ttoiCStringתΪ
+ Assert::AreEqual(nReal, _ttoi(nExpect));
+ }
+
+ }
+
+ };
+}
diff --git a/mul/C/UnitTest1/UnitTest1.vcxproj b/mul/C/UnitTest1/UnitTest1.vcxproj
new file mode 100644
index 0000000..40ff9d8
--- /dev/null
+++ b/mul/C/UnitTest1/UnitTest1.vcxproj
@@ -0,0 +1,175 @@
+
+
+
+
+ Debug
+ Win32
+
+
+ Release
+ Win32
+
+
+ Debug
+ x64
+
+
+ Release
+ x64
+
+
+
+ 16.0
+ {888C6BC4-668C-4C89-97CE-8108E4583F92}
+ Win32Proj
+ UnitTest1
+ 10.0
+ NativeUnitTestProject
+
+
+
+ DynamicLibrary
+ true
+ v142
+ MultiByte
+ false
+
+
+ DynamicLibrary
+ false
+ v142
+ true
+ Unicode
+ false
+
+
+ DynamicLibrary
+ true
+ v142
+ Unicode
+ false
+
+
+ DynamicLibrary
+ false
+ v142
+ true
+ Unicode
+ false
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ true
+
+
+ true
+
+
+ false
+
+
+ false
+
+
+
+ Use
+ Level3
+ true
+ $(VCInstallDir)UnitTest\include;%(AdditionalIncludeDirectories)
+ WIN32;_DEBUG;%(PreprocessorDefinitions)
+ true
+ pch.h
+
+
+ Windows
+ $(VCInstallDir)UnitTest\lib;%(AdditionalLibraryDirectories)
+ ..\C\Debug\mul.obj;%(AdditionalDependencies)
+ DebugFull
+
+
+
+
+ Use
+ Level3
+ true
+ $(VCInstallDir)UnitTest\include;%(AdditionalIncludeDirectories)
+ _DEBUG;%(PreprocessorDefinitions)
+ true
+ pch.h
+
+
+ Windows
+ $(VCInstallDir)UnitTest\lib;%(AdditionalLibraryDirectories)
+
+
+
+
+ Use
+ Level3
+ true
+ true
+ true
+ $(VCInstallDir)UnitTest\include;%(AdditionalIncludeDirectories)
+ WIN32;NDEBUG;%(PreprocessorDefinitions)
+ true
+ pch.h
+
+
+ Windows
+ true
+ true
+ $(VCInstallDir)UnitTest\lib;%(AdditionalLibraryDirectories)
+
+
+
+
+ Use
+ Level3
+ true
+ true
+ true
+ $(VCInstallDir)UnitTest\include;%(AdditionalIncludeDirectories)
+ NDEBUG;%(PreprocessorDefinitions)
+ true
+ pch.h
+
+
+ Windows
+ true
+ true
+ $(VCInstallDir)UnitTest\lib;%(AdditionalLibraryDirectories)
+
+
+
+
+ Create
+ Create
+ Create
+ Create
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/mul/C/UnitTest1/pch.cpp b/mul/C/UnitTest1/pch.cpp
new file mode 100644
index 0000000..eb28fa4
--- /dev/null
+++ b/mul/C/UnitTest1/pch.cpp
@@ -0,0 +1,45 @@
+/// pch.cpp: 与预编译标头对应的源文件
+#include
+#include "pch.h"
+#include
+int CalcCount(int n, char(*str)[10])
+{
+ TCHAR chSectionNames[2048] = { 0 };//定义一个数组,保存读取节的名字
+ char* pSectionName; //保存找到的某个节名字符串的首地址
+ int i = 0; //i指向数组chSectionNames的某个位置,从0开始,顺序后移
+ int j = 0; //j用来保存下一个节名字符串的首地址相对于当前i的位置偏移量
+ int k = 0; //临时变量,用于给str数组赋值
+ int m = 0; //临时变量,用于给str数组赋值
+ int count = 0; //统计节的个数
+ GetPrivateProfileSectionNames(chSectionNames, 2048, "..//ex1.ini");//获取文件中的节名,每个节名以"\0"分割,保存在chSectionNames中
+ //要加头文件
+ for (i = 0; i < 2048; i++, j++)//对chSectionName中保存的内容进行拆分
+ {
+ if (chSectionNames[0] == '\0')//如果第一个字符就是0,则说明ini中一个节也没有,
+ {
+ break;
+ }
+ if (chSectionNames[i] == '\0')
+ {
+ count++;
+ pSectionName = &chSectionNames[i - j]; //找到一个0,则说明从这个字符往前,减掉j个偏移量,
+ //就是一个节名的首地址
+ j = -1; //找到一个节名后,j的值要还原,以统计下一个节名地址的偏移量
+ //赋成-1是因为节名字符串的最后一个字符0是终止符,不能作为节名
+ for (m = 0; m <= strlen(pSectionName); m++)//把找到的节名保存到str中
+ {
+ str[k][m] = *(pSectionName + m);
+ }
+ //str[k][++m] = '\0';//手动给节名加上\0,表示这个节名结束
+ k++;//变量自加,用来保存下一个节名
+ //在获取节名的时候可以获取该节中键的值,前提是我们知道该节中有哪些键。
+ if (chSectionNames[i + 1] == 0)
+ {
+ break; //当两个相邻的字符都是0时,则所有的节名都已找到,循环终止
+ }
+ }
+ }
+ return count;//返回节名的个数
+}
+
+// 当使用预编译的头时,需要使用此源文件,编译才能成功。
diff --git a/mul/C/UnitTest1/pch.h b/mul/C/UnitTest1/pch.h
new file mode 100644
index 0000000..90cc566
--- /dev/null
+++ b/mul/C/UnitTest1/pch.h
@@ -0,0 +1,12 @@
+// pch.h: 这是预编译标头文件。
+// 下方列出的文件仅编译一次,提高了将来生成的生成性能。
+// 这还将影响 IntelliSense 性能,包括代码完成和许多代码浏览功能。
+// 但是,如果此处列出的文件中的任何一个在生成之间有更新,它们全部都将被重新编译。
+// 请勿在此处添加要频繁更新的文件,这将使得性能优势无效。
+
+#ifndef PCH_H
+#define PCH_H
+int CalcCount(int n, char(*str)[10]);
+// 添加要在此处预编译的标头
+
+#endif //PCH_H
diff --git a/mul/C/ex1.ini b/mul/C/ex1.ini
new file mode 100644
index 0000000..c5b9164
--- /dev/null
+++ b/mul/C/ex1.ini
@@ -0,0 +1,14 @@
+[TestMethod1]
+na=4
+nb=4
+nExpect=16
+[TestMethod2]
+na=3
+nb=7
+nExpect=21
+[TestMethod3]
+na=3
+nb=5
+nExpect=15
+
+
diff --git a/mul/mul函数及其单元测试说明.md b/mul/mul函数及其单元测试说明.md
new file mode 100644
index 0000000..8f4c5c0
--- /dev/null
+++ b/mul/mul函数及其单元测试说明.md
@@ -0,0 +1,132 @@
+# mul函数说明文档
+## 一、工程说明
+- 本工程的配置类型是一个动态库文件,使用的方法是生成.def文件,目的是生成一个可被其他工程调用动态库,动态库的函数功能是:输入两个int类型的数,返回两数之积。
+## 二、头文件 mul.h ,放的是mul函数的声明
+```C
+/*
+**函数名: mul
+**参数:int ,int
+**返回值:long long
+**函数功能:传入两个int类型的参数,对其进行乘法运算并返回两数之积,因为两个int型数相乘结果可能会超出int范围,所以返回值用long long。
+*/
+#pragma once
+long long _stdcall mul(int x, int y);//这里暂时不太清楚为啥要加_stdcall,但是不加调用的时候会抛异常#
+```
+## 三、源文件 mul.cpp ,放的是mul函数的定义
+```C
+#include "mul.h"
+long long _stdcall mul(int x, int y)
+{
+ return (long long)x * (long long)y;
+}
+```
+## 四、def文件内容 Source.def
+ ```
+ LIBRARY "Source"
+ EXPORTS
+ mul @1
+
+ ```
+## 五、单元测试
+- 手动创建ini文件并添加测试样例,之后在单元测试的源文件里对ini文件进行读取解析 ,完成以后获取单元测试的结果,保证代码覆盖率在80%以上。其中对ini文件的读取另封装了函数,见下面的源码。
+1. ini文件内容 exl.ini
+ ```
+ [TestMethod1] #测试样例1
+ na=10 #函数第一个入数
+ nb=4 #函数第二个入参
+ nExpect=40 #两个入参相乘的正确结果
+ [TestMethod2]
+ na=3
+ nb=7
+ nExpect=21
+ [TestMethod3]
+ na=3
+ nb=5
+ nExpect=15
+ ```
+2. 读取ini文件的函数 int CalcCount(int n, char(*str)[10])
+```C
+/*
+**函数功能:获取一个ini文件里有多少个节,并通过二维指针数组将节名带出来。
+* 函数名:CalcCount()
+* 入参:int n --------节的个数
+* char (*str)[10] --------二维数组指针,10是节名的长度,可以根据需求修改
+*返回值:int --------返回节的个数
+*/
+int CalcCount(int n, char(*str)[10])
+int CalcCount(int n, char(*str)[10])
+{
+ TCHAR chSectionNames[2048] = { 0 };//定义一个数组,保存读取节的名字
+ char* pSectionName; //保存找到的某个节名字符串的首地址
+ int i = 0; //i指向数组chSectionNames的某个位置,从0开始,顺序后移
+ int j = 0; //j用来保存下一个节名字符串的首地址相对于当前i的位置偏移量
+ int k = 0; //临时变量,用于给str数组赋值
+ int m = 0; //临时变量,用于给str数组赋值
+ int count = 0; //统计节的个数
+ GetPrivateProfileSectionNames(chSectionNames, 2048, "..//ex1.ini");//获取文件中的节名,每个节名以"\0"分割,保存在chSectionNames中
+ //要加头文件
+ for (i = 0; i < 2048; i++, j++)//对chSectionName中保存的内容进行拆分
+ {
+ if (chSectionNames[0] == '\0')//如果第一个字符就是0,则说明ini中一个节也没有,
+ {
+ break;
+ }
+ if (chSectionNames[i] == '\0')
+ {
+ count++;
+ pSectionName = &chSectionNames[i - j]; //找到一个0,则说明从这个字符往前,减掉j个偏移量,
+ //就是一个节名的首地址
+ j = -1; //找到一个节名后,j的值要还原,以统计下一个节名地址的偏移量
+ //赋成-1是因为节名字符串的最后一个字符0是终止符,不能作为节名
+ for (m = 0; m <= strlen(pSectionName); m++)//把找到的节名保存到str中
+ {
+ str[k][m] = *(pSectionName + m);
+ }
+ k++;//变量自加,用来保存下一个节名
+ //在获取节名的时候可以获取该节中键的值,前提是我们知道该节中有哪些键。
+ if (chSectionNames[i + 1] == 0)
+ {
+ break; //当两个相邻的字符都是0时,则所有的节名都已找到,循环终止
+ }
+ }
+ }
+ return count;//返回节名的个数
+}
+```
+3. 单元测试源码 UNITest1.cpp
+```C
+#include "pch.h"
+#include "CppUnitTest.h"
+#include
+#include
+#include "../C/mul.h"
+#define FilePath "../ex1.ini"
+using namespace Microsoft::VisualStudio::CppUnitTestFramework;
+
+namespace UnitTest1
+{
+ TEST_CLASS(UnitTest1)
+ {
+ public:
+ int j = 0;//循环变量,用来访问ini文件中的 节
+ char str[50][10] = { 0 };//存放ini文件里 节的名字
+ int count = CalcCount(50, str);//保存ini文件里 节的个数
+ TEST_METHOD(TestMethode1)
+ {
+ int nReal;//保存运算结果
+ CString na, nb, nExpect; //保存测试样例中的键值
+ for (j = 0; j < count; j++)//遍历读取测试样例
+ {
+ GetPrivateProfileString(str[j], "na", " ", na.GetBuffer(20), 20, FilePath);//读取第一个参数,保存在na里
+ GetPrivateProfileString(str[j], "nb", " ", nb.GetBuffer(20), 20, FilePath);//读取第二个参数,保存在nb里
+ GetPrivateProfileString(str[j], "nExpect", " ", nExpect.GetBuffer(20), 20, FilePath);//读取正确的值,保存在nExpect里
+ nReal = mul(_ttoi(na), _ttoi(nb)); //_ttoi是CString转为整型,把运算结果给nReal
+ Assert::AreEqual(nReal, _ttoi(nExpect));//对比运算结果和正确结果
+ }
+
+ }
+ };
+}
+```
+4. 附加测试结果
+
diff --git a/mul/pic/mul.jpg b/mul/pic/mul.jpg
new file mode 100644
index 0000000..03799ee
Binary files /dev/null and b/mul/pic/mul.jpg differ