-
Notifications
You must be signed in to change notification settings - Fork 12
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Cmake basic #18
base: cg-3k-3m-9
Are you sure you want to change the base?
Cmake basic #18
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great work. I made a few suggestions. Please review them. I tested the cmake build on MacOS it worked well.
#include <string> | ||
#include <functional> | ||
|
||
class TestP528DataTables : public ::testing::TestWithParam<std::string> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It would be good to have a brief description of what tests are being preformed
To manually build the project, you can run the following commands step by step. As an example, we use /cmake_build as CMake build folder (cmake binary folder) and /if77install as installation folder. | ||
|
||
``` | ||
mkdir cmake_build |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I tested the cmake build a Mac and got three warnings. Please look at them and decide if they should be addressed or not.
[ 81%] Built target gtest_main
[ 84%] Building CXX object test/CMakeFiles/p528GTest.dir/p528/test/src/P528GTestUtils.cpp.o
/p528/test/src/P528GTestUtils.cpp:119:49: warning: implicit conversion of NULL constant to 'double' [-Wnull-conversion]
d.expectedResult.A_fs__db = NULL;
~ ^~~~
0.0
1 warning generated.
[ 86%] Building CXX object test/CMakeFiles/p528GTest.dir/p528/test/src/TestP528.cpp.o
[ 88%] Building CXX object test/CMakeFiles/p528GTest.dir/p528/test/src/TestP528DataTables.cpp.o
/p528/test/src/TestP528DataTables.cpp:34:42: warning: comparison between NULL and non-pointer ('double' and NULL) [-Wnull-arithmetic]
if (data.expectedResult.A_fs__db != NULL) {
~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ^ ~~~~
/p528/test/src/TestP528DataTables.cpp:34:45: warning: implicit conversion of NULL constant to 'double' [-Wnull-conversion]
if (data.expectedResult.A_fs__db != NULL) {
~~ ^~~~
0.0
/p528/test/src/TestP528DataTables.cpp:41:1: warning: 'InstantiateTestCase_P_IsDeprecated' is deprecated: INSTANTIATE_TEST_CASE_P is deprecated, please use INSTANTIATE_TEST_SUITE_P [-Wdeprecated-declarations]
INSTANTIATE_TEST_CASE_P(
^
/p528/test/lib/googletest/googletest/include/gtest/gtest-param-test.h:539:38: note: expanded from macro 'INSTANTIATE_TEST_CASE_P'
static_assert(::testing::internal::InstantiateTestCase_P_IsDeprecated(), \
^
/p528/test/lib/googletest/googletest/include/gtest/internal/gtest-internal.h:1244:1: note: 'InstantiateTestCase_P_IsDeprecated' has been explicitly marked deprecated here
GTEST_INTERNAL_DEPRECATED(
^
/p528/test/lib/googletest/googletest/include/gtest/internal/gtest-port.h:2383:59: note: expanded from macro 'GTEST_INTERNAL_DEPRECATED'
#define GTEST_INTERNAL_DEPRECATED(message) __attribute__((deprecated(message)))
^
3 warnings generated.
[ 90%] Linking CXX executable ../p528GTest
std::cout << "TestP528 from Data Table '" << fileName << "', " << testData.size() << " Test instances." << std::endl; | ||
for (const auto& data : testData) { | ||
Result result; | ||
int rtn = P528(data.d__km, data.h_1__meter, data.h_2__meter, data.f__mhz, data.T_pol, data.p, &result); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The rtn
is not used.
test/src/P528GTestUtils.cpp
Outdated
} | ||
if (csvRows[1].size() > 2) { | ||
//std::cout << csvRows[1][2] << std::endl; | ||
for (int i = 2; i < csvRows[1].size(); i++) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Using int
here causes a mismatch between datatype of i
and the value returned by csvRows[1].size()
and the compiler complains when using the -Wall
option. This can be avoided using the same type that is returned by the size()
function. Its type is long so typedef
ing can help declutter the code. This issue also happens in other for
loops in this file.
for (int i = 2; i < csvRows[1].size(); i++) { | |
typedef std::vector<std::vector<std::string> >::size_type vec_size_t | |
for (vec_size_t i = 2; i < csvRows[1].size(); i++) { |
return ret; | ||
} | ||
|
||
std::vector<InputsAndResult> ReadP528InputsAndResultFromDataTable(const std::string& filename, int testStep) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please add a comment with a brief description of what the functions do.
test/src/P528GTestUtils.cpp
Outdated
//std::cout << entry.path() << std::endl; | ||
//std::string filename = entry.path().filename(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this dead code? If so, please remove it.
No changes on repository folder structure for now.