summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorChristoph Schlosser <christoph@linux.com>2018-07-06 19:49:02 +0200
committerChristoph Schlosser <christoph@linux.com>2018-07-06 19:49:02 +0200
commitd438622d71b94789b7ccc672cdd9d81f77570f87 (patch)
tree01e6fe9624ffb94a5e9427c7e016311c4e0caa2b /src
parentfc8b744aac786e416e6663490f2efbf40b016964 (diff)
downloaddoxdocgen-d438622d71b94789b7ccc672cdd9d81f77570f87.tar.gz
Update unit tests
Remove seperate file. Move into parameters test. Add new one to function pointers.
Diffstat (limited to 'src')
-rw-r--r--src/test/CppTests/FunctionPointer.test.ts5
-rw-r--r--src/test/CppTests/MemberPointers.test.ts23
-rw-r--r--src/test/CppTests/Parameters.test.ts5
3 files changed, 10 insertions, 23 deletions
diff --git a/src/test/CppTests/FunctionPointer.test.ts b/src/test/CppTests/FunctionPointer.test.ts
index a353380..7a4383c 100644
--- a/src/test/CppTests/FunctionPointer.test.ts
+++ b/src/test/CppTests/FunctionPointer.test.ts
@@ -39,4 +39,9 @@ suite("C++ - Function pointer Tests", () => {
assert.equal("/**\n * @brief \n * \n * @param puts \n * @param str "
+ "\n * @return const struct foo(*)(const char*) \n */", result);
});
+
+ test("Memberpointer in function pointer", () => {
+ const result = testSetup.SetLine("void foo(void (SomeClass::* func)());").GetResult();
+ assert.equal("/**\n * @brief \n * \n * @param func \n */", result);
+ });
});
diff --git a/src/test/CppTests/MemberPointers.test.ts b/src/test/CppTests/MemberPointers.test.ts
deleted file mode 100644
index 38410c4..0000000
--- a/src/test/CppTests/MemberPointers.test.ts
+++ /dev/null
@@ -1,23 +0,0 @@
-//
-// Note: This example test is leveraging the Mocha test framework.
-// Please refer to their documentation on https://mochajs.org/ for help.
-//
-
-// The module 'assert' provides assertion methods from node
-import * as assert from "assert";
-
-// You can import and use all API from the 'vscode' module
-// as well as import your extension to test it
-import * as vscode from "vscode";
-import TestSetup from "./TestSetup";
-
-// Defines a Mocha test suite to group tests of similar kind together
-suite("C++ - Member pointers tests", () => {
- const testSetup: TestSetup = new TestSetup("void foo();");
-
- // tests
- test("Simple", () => {
- const result = testSetup.SetLine("void test(int foo::* memberPointer);").GetResult();
- assert.equal("/**\n * @brief \n * \n * @param memberPointer \n */", result);
- });
-});
diff --git a/src/test/CppTests/Parameters.test.ts b/src/test/CppTests/Parameters.test.ts
index 8505826..6e7293b 100644
--- a/src/test/CppTests/Parameters.test.ts
+++ b/src/test/CppTests/Parameters.test.ts
@@ -252,4 +252,9 @@ suite("C++ - Parameters Tests", () => {
const result = testSetup.SetLine("void foo(double a1 = 0xa.bp10l_deg_test, int b);").GetResult();
assert.equal("/**\n * @brief \n * \n * @param a1 \n * @param b \n */", result);
});
+
+ test("Member pointer as parameter", () => {
+ const result = testSetup.SetLine("void test(int foo::* memberPointer);").GetResult();
+ assert.equal("/**\n * @brief \n * \n * @param memberPointer \n */", result);
+ });
});