From ab10903637ceacb95fb47003ca512925b8d7faa3 Mon Sep 17 00:00:00 2001 From: Christoph Schlosser Date: Sat, 5 Oct 2019 13:10:15 +0200 Subject: Fix tests --- src/test/CppTests/Con-AndDestructor.test.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/test') 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); }); -- cgit v1.2.3 From 23e24325bac129e723537be4096f053ac3394850 Mon Sep 17 00:00:00 2001 From: Christoph Schlosser Date: Sat, 5 Oct 2019 14:03:04 +0200 Subject: Fix test lines --- src/test/CppTests/Operators.test.ts | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'src/test') 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); }); }); -- cgit v1.2.3 From 1cf0a3b9762ad5734352fa25514e50caf27ae52f Mon Sep 17 00:00:00 2001 From: Christoph Schlosser Date: Sat, 5 Oct 2019 15:28:09 +0200 Subject: Ignore restrict keyword --- src/test/CppTests/Parameters.test.ts | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'src/test') 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); -- cgit v1.2.3 From 6e749554cc7a47849bd63d7ec1027f084d26b505 Mon Sep 17 00:00:00 2001 From: Christoph Schlosser Date: Sat, 5 Oct 2019 16:50:54 +0200 Subject: Add arraypointers --- src/test/CppTests/FunctionPointer.test.ts | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'src/test') 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); + }); }); -- cgit v1.2.3 From 3c16da1b09b4a7490e2139d1ee3b96e4ed096806 Mon Sep 17 00:00:00 2001 From: Christoph Schlosser Date: Tue, 8 Oct 2019 19:13:55 +0200 Subject: End of declaration problem fixed If the terminating character is the first one on the next line it can cause the buffer to fill and thus produce malformed text to parse. --- src/test/CppTests/Attributes.test.ts | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'src/test') 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); + }); }); -- cgit v1.2.3