diff options
Diffstat (limited to 'src/test')
| -rw-r--r-- | src/test/CppTests/Attributes.test.ts | 5 | ||||
| -rw-r--r-- | src/test/CppTests/Con-AndDestructor.test.ts | 2 | ||||
| -rw-r--r-- | src/test/CppTests/FunctionPointer.test.ts | 5 | ||||
| -rw-r--r-- | src/test/CppTests/Operators.test.ts | 8 | ||||
| -rw-r--r-- | src/test/CppTests/Parameters.test.ts | 5 |
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); |