summaryrefslogtreecommitdiffstats
path: root/src/test/CppTests
diff options
context:
space:
mode:
authorZongyuan Zuo <eternalphane@gmail.com>2019-11-16 11:13:48 +0800
committerGitHub <noreply@github.com>2019-11-16 11:13:48 +0800
commit05fee9e8eb71c8ed1c3f6e47110040c105cd42eb (patch)
tree74a7de00fc142bcac8e93bf724553d9efd536847 /src/test/CppTests
parent5648d5ed96d6150f14530f14df5842dc248bf4be (diff)
parentd12cfa9537790ce3489967f77de18ef52717daeb (diff)
downloaddoxdocgen-05fee9e8eb71c8ed1c3f6e47110040c105cd42eb.tar.gz
Merge branch 'master' into master
Diffstat (limited to 'src/test/CppTests')
-rw-r--r--src/test/CppTests/Attributes.test.ts5
-rw-r--r--src/test/CppTests/Con-AndDestructor.test.ts2
-rw-r--r--src/test/CppTests/FunctionPointer.test.ts5
-rw-r--r--src/test/CppTests/Operators.test.ts8
-rw-r--r--src/test/CppTests/Parameters.test.ts5
5 files changed, 20 insertions, 5 deletions
diff --git a/src/test/CppTests/Attributes.test.ts b/src/test/CppTests/Attributes.test.ts
index bfeaef1..a6641e1 100644
--- a/src/test/CppTests/Attributes.test.ts
+++ b/src/test/CppTests/Attributes.test.ts
@@ -59,4 +59,9 @@ suite("C++ - Attributes Tests", () => {
const result = testSetup.SetLine("constexpr int foo(int a, double& b) throw(std::except);").GetResult();
assert.equal("/**\n * @brief \n * \n * @param a \n * @param b \n * @return constexpr int \n */", result);
});
+
+ test("Newline in function", () => {
+ const result = testSetup.SetLines(["static void ResetActionState( BOOL sendNAK )", "{"]).GetResult();
+ assert.equal("/**\n * @brief \n * \n * @param sendNAK \n */", result);
+ });
});
diff --git a/src/test/CppTests/Con-AndDestructor.test.ts b/src/test/CppTests/Con-AndDestructor.test.ts
index 36e4fd6..ba60501 100644
--- a/src/test/CppTests/Con-AndDestructor.test.ts
+++ b/src/test/CppTests/Con-AndDestructor.test.ts
@@ -54,7 +54,7 @@ suite("C++ - Con- and Destructor Tests", () => {
});
test("Deleted Destructor", () => {
- const result = testSetup.SetLine("virtual ~Foo() = 0").GetResult();
+ const result = testSetup.SetLine("virtual ~Foo() = 0;").GetResult();
assert.equal("/**\n * @brief \n * \n */", result);
});
diff --git a/src/test/CppTests/FunctionPointer.test.ts b/src/test/CppTests/FunctionPointer.test.ts
index 7a4383c..cd318ce 100644
--- a/src/test/CppTests/FunctionPointer.test.ts
+++ b/src/test/CppTests/FunctionPointer.test.ts
@@ -44,4 +44,9 @@ suite("C++ - Function pointer Tests", () => {
const result = testSetup.SetLine("void foo(void (SomeClass::* func)());").GetResult();
assert.equal("/**\n * @brief \n * \n * @param func \n */", result);
});
+
+ test("Arraypointer", () => {
+ const result = testSetup.SetLine("void some_function(int (*table)[]);").GetResult();
+ assert.equal("/**\n * @brief \n * \n * @param table \n */", result);
+ });
});
diff --git a/src/test/CppTests/Operators.test.ts b/src/test/CppTests/Operators.test.ts
index 09f5dd4..b35cc81 100644
--- a/src/test/CppTests/Operators.test.ts
+++ b/src/test/CppTests/Operators.test.ts
@@ -279,22 +279,22 @@ suite("C++ - Operators Tests", () => {
});
test("Implicit conversion operator", () => {
- const result = testSetup.SetLine("operator int() const").GetResult();
+ const result = testSetup.SetLine("operator int() const;").GetResult();
assert.equal("/**\n * @brief \n * \n * @return int \n */", result);
});
test("Explicit conversion operator", () => {
- const result = testSetup.SetLine("explicit operator int() const").GetResult();
+ const result = testSetup.SetLine("explicit operator int() const;").GetResult();
assert.equal("/**\n * @brief \n * \n * @return int \n */", result);
});
test("conversion operator to struct", () => {
- const result = testSetup.SetLine("explicit operator struct foo() const").GetResult();
+ const result = testSetup.SetLine("explicit operator struct foo() const;").GetResult();
assert.equal("/**\n * @brief \n * \n * @return struct foo \n */", result);
});
test("conversion operator to struct pointer", () => {
- const result = testSetup.SetLine("explicit operator struct foo*() const").GetResult();
+ const result = testSetup.SetLine("explicit operator struct foo*() const;").GetResult();
assert.equal("/**\n * @brief \n * \n * @return struct foo* \n */", result);
});
});
diff --git a/src/test/CppTests/Parameters.test.ts b/src/test/CppTests/Parameters.test.ts
index 9c99100..cfcebe8 100644
--- a/src/test/CppTests/Parameters.test.ts
+++ b/src/test/CppTests/Parameters.test.ts
@@ -263,6 +263,11 @@ suite("C++ - Parameters Tests", () => {
assert.equal("/**\n * @brief \n * \n * @param memberPointer \n */", result);
});
+ test("Restrict keyword", () => {
+ const result = testSetup.SetLine("void some_function(char *restrict buf, const size_t buflen);").GetResult();
+ assert.equal("/**\n * @brief \n * \n * @param buf \n * @param buflen \n */", result);
+ });
+
test("Type as variable name", () => {
let result = testSetup.SetLine("void MapPoint(double latitude, double longtitude) const;").GetResult();
assert.equal("/**\n * @brief \n * \n * @param latitude \n * @param longtitude \n */", result);