Skip to content
This repository was archived by the owner on Dec 24, 2025. It is now read-only.

[task_02] Osovets#174

Merged
Lictwin merged 26 commits into
brstu:mainfrom
a-osovets:AS-OSOV2
Dec 24, 2025
Merged

[task_02] Osovets#174
Lictwin merged 26 commits into
brstu:mainfrom
a-osovets:AS-OSOV2

Conversation

@a-osovets
Copy link
Copy Markdown
Contributor

@a-osovets a-osovets commented Dec 10, 2025

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

  • Wrapped Windows-only console initialization (SetConsoleOutputCP, SetConsoleCP)
    in #ifdef _WIN32, so the code now compiles on Linux.
  • Removed unconditional inclusion of <windows.h> to avoid build errors.
  • Verified that the simulation logic (simulateLinear, simulateNonlinear)
    works the same as before.
  • Improved overall portability without touching core logic.

Why this is safe

  • The Windows-specific code is now isolated and does not affect Linux builds.
  • Linux CI runners compile successfully without errors.
  • The runtime behavior on Windows remains unchanged.
  • No functional algorithms were modified.

Testing

  • Successfully compiled and ran the project on Linux.
  • Verified that Windows build still works as expected.
  • Simulation outputs are consistent between platforms.

This PR only improves portability and does not introduce any functional risks.

Copilot AI review requested due to automatic review settings December 10, 2025 18:46
@github-actions
Copy link
Copy Markdown

github-actions Bot commented Dec 10, 2025

📌 Duplicate code detection tool report

The 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

File Similarity (%)
trunk/as06505/task_02/src/func.cpp 93.87 ⚠️
trunk/as06504/task_02/doc/readme.md

📄 trunk/as06504/task_02/doc/readme.md

File Similarity (%)
trunk/as06607/task_02/doc/readme.md 93.98 ⚠️
trunk/as06507/task_02/doc/readme.md 92.81
trunk/as06505/task_02/src/func.cpp

📄 trunk/as06505/task_02/src/func.cpp

File Similarity (%)
trunk/as06503/task_02/src/func.cpp 93.87 ⚠️
trunk/as06506/task_01/src/laba1tmau.cpp

📄 trunk/as06506/task_01/src/laba1tmau.cpp

File Similarity (%)
trunk/as06506/task_02/src/main.cpp 93.47 ⚠️
trunk/as06506/task_02/src/main.cpp

📄 trunk/as06506/task_02/src/main.cpp

File Similarity (%)
trunk/as06506/task_01/src/laba1tmau.cpp 93.47 ⚠️
trunk/as06507/task_02/doc/readme.md

📄 trunk/as06507/task_02/doc/readme.md

File Similarity (%)
trunk/as06504/task_02/doc/readme.md 92.81
trunk/as06607/task_02/doc/readme.md 92.45
trunk/as06519/task_01/src/main.cpp

📄 trunk/as06519/task_01/src/main.cpp

File Similarity (%)
trunk/as06519/task_02/src/main.cpp 92.46
trunk/as06519/task_02/src/main.cpp

📄 trunk/as06519/task_02/src/main.cpp

File Similarity (%)
trunk/as06519/task_01/src/main.cpp 92.46
trunk/as06523/task_01/src/main.cpp

📄 trunk/as06523/task_01/src/main.cpp

File Similarity (%)
trunk/as6513/task_01/src/as65013.cpp 93.11 ⚠️
trunk/as06604/task_01/src/main.cpp

📄 trunk/as06604/task_01/src/main.cpp

File Similarity (%)
trunk/as06604/task_02/src/main.cpp 94.6 ⚠️
trunk/as06604/task_02/src/main.cpp

📄 trunk/as06604/task_02/src/main.cpp

File Similarity (%)
trunk/as06604/task_01/src/main.cpp 94.6 ⚠️
trunk/as06607/task_02/doc/readme.md

📄 trunk/as06607/task_02/doc/readme.md

File Similarity (%)
trunk/as06504/task_02/doc/readme.md 93.98 ⚠️
trunk/as06507/task_02/doc/readme.md 92.45
trunk/as06608/task_02/src/func.h

📄 trunk/as06608/task_02/src/func.h

File Similarity (%)
trunk/as06621/task_02/src/func.h 92.3
trunk/as06615/task_01/src/main.cpp

📄 trunk/as06615/task_01/src/main.cpp

File Similarity (%)
trunk/as06615/task_02/src/main.cpp 93.88 ⚠️
trunk/as06615/task_02/src/main.cpp

📄 trunk/as06615/task_02/src/main.cpp

File Similarity (%)
trunk/as06615/task_01/src/main.cpp 93.88 ⚠️
trunk/as06615/task_06/doc/README.md

📄 trunk/as06615/task_06/doc/README.md

File Similarity (%)
trunk/as06615/task_07/doc/README.md 92.85
trunk/as06615/task_07/doc/README.md

📄 trunk/as06615/task_07/doc/README.md

File Similarity (%)
trunk/as06615/task_06/doc/README.md 92.85
trunk/as06621/task_02/src/func.h

📄 trunk/as06621/task_02/src/func.h

File Similarity (%)
trunk/as06608/task_02/src/func.h 92.3
trunk/as6513/task_01/src/as65013.cpp

📄 trunk/as6513/task_01/src/as65013.cpp

File Similarity (%)
trunk/as06523/task_01/src/main.cpp 93.11 ⚠️

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Comment thread trunk/as06617/task_02/src/main.cpp Outdated
Comment thread trunk/as06617/task_02/src/main.cpp Outdated
Comment thread trunk/as06617/task_02/doc/readme.md Outdated
Comment thread trunk/as06617/task_02/doc/readme.md Outdated
Comment thread trunk/as06617/task_02/doc/readme.md Outdated
Comment thread trunk/as06617/task_02/doc/readme.md Outdated
Comment thread trunk/as06617/task_02/src/main.cpp Outdated
Comment thread trunk/as06617/task_02/doc/readme.md Outdated
Comment thread trunk/as06617/task_02/doc/readme.md Outdated
Comment thread trunk/as06617/task_02/doc/readme.md Outdated
Copilot AI review requested due to automatic review settings December 10, 2025 18:56
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Comment thread trunk/as06617/task_02/doc/readme.md Outdated
Comment thread trunk/as06617/task_02/doc/readme.md Outdated
Comment thread trunk/as06617/task_02/src/main.cpp Outdated
Comment thread trunk/as06617/task_02/.vscode/launch.json
Comment thread trunk/as06617/task_02/src/main.cpp Outdated
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Comment thread trunk/as06617/task_02/doc/readme.md Outdated
Comment thread trunk/as06617/task_02/src/main.cpp Outdated
Comment thread trunk/as06617/task_01/doc/README.md Outdated
Comment thread trunk/as06617/task_02/.vscode/launch.json
Comment thread trunk/as06617/task_02/test/tests.cpp Outdated
Comment thread trunk/as06617/task_01/doc/README.md Outdated
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Comment thread trunk/as06617/task_02/src/main.cpp Outdated
Comment thread trunk/as06617/task_02/src/main.cpp Outdated
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Comment thread trunk/as06617/task_02/test/tests.cpp Outdated
Comment thread trunk/as06617/task_02/src/main.cpp Outdated
Comment thread trunk/as06617/task_02/test/tests.cpp Outdated
Comment thread trunk/as06617/task_02/test/tests.cpp Outdated
Copilot AI review requested due to automatic review settings December 10, 2025 19:43
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Comment thread trunk/as06617/task_02/src/main.cpp Outdated
Comment thread trunk/as06617/task_02/doc/readme.md Outdated
Copilot AI review requested due to automatic review settings December 10, 2025 19:47
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Comment thread trunk/as06617/task_02/doc/readme.md Outdated
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Comment thread CMakeLists.txt
Copilot AI review requested due to automatic review settings December 23, 2025 23:13
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Comment thread .vscode/c_cpp_properties.json
Comment thread trunk/as06617/task_02/src/tests.cpp Outdated
Comment thread trunk/as06617/task_02/.vscode/launch.json
Comment thread trunk/as06617/task_02/src/tests.cpp Outdated
Comment thread trunk/as06617/task_02/src/tests.cpp Outdated
Comment thread trunk/as06617/task_02/src/tests.cpp Outdated
Copilot AI review requested due to automatic review settings December 23, 2025 23:19
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Comment thread trunk/as06617/task_02/src/tests.cpp Outdated
Comment thread trunk/as06617/task_02/src/tests.cpp Outdated
Comment thread trunk/as06617/task_02/.vscode/launch.json
Lictwin
Lictwin previously approved these changes Dec 24, 2025
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Comment thread trunk/as06617/task_02/doc/README.md Outdated
Comment thread trunk/as06617/task_02/doc/README.md Outdated
Copilot AI review requested due to automatic review settings December 24, 2025 06:30
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 inline keyword 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 without inline. Since this function is called from multiple translation units (main.cpp and tests.cpp), it should either be defined in the header with inline, or remain as a regular function definition in the .cpp file without the inline keyword.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread trunk/as06617/task_02/src/func.cpp
Comment thread trunk/as06617/task_02/src/func.cpp
Comment thread .vscode/c_cpp_properties.json
@sonarqubecloud
Copy link
Copy Markdown

@Lictwin Lictwin merged commit 013a1e6 into brstu:main Dec 24, 2025
6 checks passed
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants