diff --git a/.gitignore b/.gitignore index dbe9c82..e6e9a85 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1 @@ -.vscode/ \ No newline at end of file +patch/ diff --git a/JJL.c b/JJL.c index 82865e4..c1c83c0 100644 --- a/JJL.c +++ b/JJL.c @@ -10,6 +10,12 @@ int sub(int a,int b) return a-b; } +void my_printf(int a) +{ + printf("\r\n\r\n%d\r\n\r\n",a); +} + + int main() { printf("hello world!"); diff --git a/JJL.h b/JJL.h new file mode 100644 index 0000000..cb2ddb4 --- /dev/null +++ b/JJL.h @@ -0,0 +1,7 @@ +#include + +using namespace std; + +void my_printf(int a); + + diff --git a/UnitTest1.cpp b/UnitTest1.cpp deleted file mode 100644 index ea56c80..0000000 --- a/UnitTest1.cpp +++ /dev/null @@ -1,57 +0,0 @@ -#include "pch.h" -#include "CppUnitTest.h" -#include "test.h" -#include -#include -#include -#include -using namespace Microsoft::VisualStudio::CppUnitTestFramework; - -void GenerateRandomArray(vector& a,int sum) -{ - srand(time(0)); // ʹÓõ±Ç°Ê±¼ä×÷ΪÖÖ×Ó - for (int i = 0; i < sum; i++) { - a.push_back(i); - } -} - - -namespace UnitTest1 -{ - TEST_CLASS(UnitTest1) - { - public: - - TEST_METHOD(TestMethod1) - { - vector arr = { 5,8,4,3,9,1 }; - const vector expect = { 1,3,4,5,8,9 }; - selectionSort(arr); - for(int i= 0;i < arr.size();i++) - { - Assert::AreEqual(expect.at(i), arr.at(i)); - } - } - TEST_METHOD(TestEmptyArr) - { - vector arr = {}; - selectionSort(arr); - Assert::IsTrue(true); - - } - BEGIN_TEST_METHOD_ATTRIBUTE(TestRunTime) - TEST_METHOD_ATTRIBUTE(L"RUN","TIME") - END_TEST_METHOD_ATTRIBUTE(TestRunTime) - TEST_METHOD(TestRunTime) - { - vector arr; - GenerateRandomArray(arr, 10000); // Éú³ÉËæ»úÊý×é - auto start = std::chrono::high_resolution_clock::now(); - selectionSort(arr); - auto end = std::chrono::high_resolution_clock::now(); - auto duration = std::chrono::duration_cast(end - start); - Logger::WriteMessage(("Time: " + std::to_string(duration.count()) + "ms").c_str()); - Assert::IsTrue(duration.count() < 10000); // É趨ãÐÖµ - } - }; -} diff --git a/readme.txt b/readme.txt new file mode 100644 index 0000000..7bd845a --- /dev/null +++ b/readme.txt @@ -0,0 +1 @@ +什么也没有 \ No newline at end of file