[task_02] Osovets#174
Conversation
📌 Duplicate code detection tool reportThe tool analyzed your source code and found the following degree of similarity between the files: trunk/as06503/task_02/src/func.cpp📄 trunk/as06503/task_02/src/func.cpp
trunk/as06504/task_02/doc/readme.md📄 trunk/as06504/task_02/doc/readme.md
trunk/as06505/task_02/src/func.cpp📄 trunk/as06505/task_02/src/func.cpp
trunk/as06506/task_01/src/laba1tmau.cpp📄 trunk/as06506/task_01/src/laba1tmau.cpp
trunk/as06506/task_02/src/main.cpp📄 trunk/as06506/task_02/src/main.cpp
trunk/as06507/task_02/doc/readme.md📄 trunk/as06507/task_02/doc/readme.md
trunk/as06519/task_01/src/main.cpp📄 trunk/as06519/task_01/src/main.cpp
trunk/as06519/task_02/src/main.cpp📄 trunk/as06519/task_02/src/main.cpp
trunk/as06523/task_01/src/main.cpp📄 trunk/as06523/task_01/src/main.cpp
trunk/as06604/task_01/src/main.cpp📄 trunk/as06604/task_01/src/main.cpp
trunk/as06604/task_02/src/main.cpp📄 trunk/as06604/task_02/src/main.cpp
trunk/as06607/task_02/doc/readme.md📄 trunk/as06607/task_02/doc/readme.md
trunk/as06608/task_02/src/func.h📄 trunk/as06608/task_02/src/func.h
trunk/as06615/task_01/src/main.cpp📄 trunk/as06615/task_01/src/main.cpp
trunk/as06615/task_02/src/main.cpp📄 trunk/as06615/task_02/src/main.cpp
trunk/as06615/task_06/doc/README.md📄 trunk/as06615/task_06/doc/README.md
trunk/as06615/task_07/doc/README.md📄 trunk/as06615/task_07/doc/README.md
trunk/as06621/task_02/src/func.h📄 trunk/as06621/task_02/src/func.h
trunk/as6513/task_01/src/as65013.cpp📄 trunk/as6513/task_01/src/as65013.cpp
|
There was a problem hiding this comment.
Pull request overview
This pull request implements laboratory work #2 for the "Theory and Methods of Automatic Control" course, adding unit tests for previously developed linear and nonlinear model simulation functions using Google Test framework.
- Refactored task_01 code into a testable structure with separate header and implementation files
- Added comprehensive unit tests for both linear and nonlinear model functions
- Integrated Google Test framework via CMake with FetchContent
Reviewed changes
Copilot reviewed 10 out of 11 changed files in this pull request and generated 10 comments.
Show a summary per file
| File | Description |
|---|---|
| trunk/as06617/task_02/test/tests.cpp | Implements 8 unit tests covering zero input, single parameter, and combined parameter scenarios for both linear and nonlinear models |
| trunk/as06617/task_02/src/main.cpp | Main application simulating linear and nonlinear models with hardcoded input patterns |
| trunk/as06617/task_02/src/func.h | Header file declaring model parameters and function prototypes |
| trunk/as06617/task_02/src/func.cpp | Implementation of linear and nonlinear model functions with defined constants |
| trunk/as06617/task_02/src/CMakeLists.txt | CMake configuration for building the application and tests with Google Test integration |
| trunk/as06617/task_02/doc/readme.md | Documentation with test descriptions, results, and coverage analysis |
| trunk/as06617/task_02/.vscode/launch.json | Empty VS Code debug configuration file |
| trunk/as06617/task_01/src/tmau.cpp | Original task_01 implementation file for context |
| trunk/as06617/task_01/src/tmau | Compiled binary artifact (should not be in version control) |
| trunk/as06617/task_01/src/CMakeLists.txt | CMake configuration for task_01 |
| trunk/as06617/task_01/doc/README.md | Documentation for task_01 with author "Осовец А.О." |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 10 out of 11 changed files in this pull request and generated 5 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 10 out of 11 changed files in this pull request and generated 6 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 10 out of 11 changed files in this pull request and generated 2 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 10 out of 11 changed files in this pull request and generated 4 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 10 out of 11 changed files in this pull request and generated 2 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 10 out of 11 changed files in this pull request and generated 1 comment.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 12 out of 13 changed files in this pull request and generated 1 comment.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 12 out of 13 changed files in this pull request and generated 6 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 12 out of 12 changed files in this pull request and generated 3 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 9 out of 9 changed files in this pull request and generated 2 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 9 out of 9 changed files in this pull request and generated 3 comments.
Comments suppressed due to low confidence (1)
trunk/as06617/task_02/src/func.cpp:27
- The
inlinekeyword on a function defined in a .cpp file has no effect and violates the One Definition Rule (ODR) when the function is also declared in the header withoutinline. Since this function is called from multiple translation units (main.cpp and tests.cpp), it should either be defined in the header withinline, or remain as a regular function definition in the .cpp file without theinlinekeyword.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|



Summary
This PR fixes the build on Linux by adding proper cross-platform guards around
Windows-specific console code. No functional changes were introduced — only
platform-dependent includes and initialization were reorganized.
Changes
SetConsoleOutputCP,SetConsoleCP)in
#ifdef _WIN32, so the code now compiles on Linux.<windows.h>to avoid build errors.simulateLinear,simulateNonlinear)works the same as before.
Why this is safe
Testing
This PR only improves portability and does not introduce any functional risks.