ShmuelFine / COOP

The C Object Oriented Programming Library
MIT License
31 stars 3 forks source link

current issue #20

Closed smartProgramerM closed 1 year ago

smartProgramerM commented 2 years ago

introdeced with the project , read the wiki ,understood the idea of coop ,and the coop syntax. made the project runnable , run the tests and fixed the project that all teats will pass (before we fixed, one test failed). read aboat catch2. now we are tring to add to the project catch2.

RonenCode commented 2 years ago

installed catch2 (hope that it really correct) started to write test in catch2 syntax (still not checked them .)

RonenCode commented 2 years ago

we downloaded chatch2 source code from github should we upload it to our repository? (so the mentors will be able to run it)

brachahold commented 2 years ago

try create CMake by CMake-converter

smartProgramerM commented 2 years ago

we added cMake with cmake converter and we try to run it . what the connection between cmake and catch2 test that we wrote already? how could we get ahead in the project ? we will be happy to get more specific instructions

MsOopsi commented 2 years ago

Hi @smartProgramerM ,

The big title here is "Convert COOP To Cross Platform": Why we can't build COOP on Linux today?

  1. Currently, COOP is built only with Microsoft Visual Studio, that uses a MSVC = MicroSoft Visual C++ Compiler. You can guess, that in this way we can't build COOP on linux. We don't have Visual Studio on Linux. And MSVC builds executables / libraries for Windows, not Linux.
  2. COOP is using Google Tests which are difficult to set up correctly on linux.

So, you should do two things:

  1. Use CMake instead of Visual Studio Solution. CMake is cross-platform.
  2. Use some other tests framework, like catch2, which is much easier to deal with on Linux.

I hope it makes things clear.

You can play a little with CMake just to learn it. It's worthwhile! Here's a nice tutorial video for windows And a very similar tutorial for mac that demonstrates how CMake really supports both Windows and Linux and Mac and android and ... what not.

RonenCode commented 2 years ago

thanks for explanation we added cmake , turned the tests to catch2 test. when we dropped from cmake list the sub project of test proxy and catch2 test project , it compiled when we adding the tests project the compilation faile we have another problem that image in all catch2 test its not compile the TEST_CASE in visual studio we will be happy to get Clear and precise instructions how to get ahead

MsOopsi commented 2 years ago

Why did you close this issue? by mistake?

Explanation about the Proxy project: You can't build C++ code with C compiler. Nor you can build pure C code with C++ compiler. If you have C++ code that uses pure C code that should be compiled with C compiler, the C++ code should use extern "C" like that: extern "C" {

include "pure_c_code.h"

} And... your tests are C++ code. so you can avoid the Proxy if you use this extern "C" trick. ORRRRRR..... You can do something else. forget about Catch2, forget about the Proxy project. Use some unit testing framework for C language, not for C++. Just search google "C unit testing framework" ORRRRRRR..... Just write yourself a simple unit testing framework for C. it's not as difficult as you think it is. and now that I think about it, it's the best option for YOU to practice. You can start with looking on Mr. Fine's unit tests in the C language course, he told me that he wrote the unit tests there himself without any framework.

smartProgramerM commented 2 years ago

thanks for help we decided to take a simple unit testing framework for C. we added it to the project. we are in the middle of checking if the test platform is working

MsOopsi commented 2 years ago

I'm so glad to hear that !! But please, push your code even if it doesn't work yet !! I know, letting other people see what you do when it's not yet just right is not a pleasant thing... but I'm on your side here, I'm not testing you, just helping you. please push at the end of the day no matter what.

RonenCode commented 2 years ago

started copy the tests function to our test platform, still have compilation error (why?, we included the coop project)

MsOopsi commented 2 years ago

How do you bulid your CMake? do you open your cmake project with visual studio directly? or with VSCode ?

RonenCode commented 2 years ago

we built our CMake with CMake_convert and we open the CMake project with visual studio directly but we compile the CMake project in the cmd.

RonenCode commented 2 years ago

We have some problem whit the CALL makro, in our platform test its not compile and we didn't understand what the purpose of CALL, We would be happy to get general explanation about it. thank you!

brachahold commented 2 years ago

CALL macro symbolizes the end of the parameters sent to the function retval is the return value that should pass by reference

smartProgramerM commented 2 years ago

we added project called "unitTestC" ,we added file tests and we started copy the tests from the proxyProject to our C platform test, we have compilation error on the "classTest.c" file with the CALL macro , The error we had is: error so we defined the __RET_VAL__ in "COOP\COOP\obj_lifecycle_management.h" file but now we have another error image we tried to find what the problem with the break and we didnt succeed we will be happy to get help. thank you!

YochevedKarlebach commented 2 years ago

You are missing 2 files (in git): .vcxproj and .vcxproj.filters in the UnitTestsC Project. Please upload them so we can try to find the problem.

MsOopsi commented 2 years ago

Please show me what the FUN opens into, and what CALL opens into, and what does the whole line look like after opening the macros

RonenCode commented 2 years ago

we have a problem with the page routing: when I am in the UnitTest project in "Class_UnitTest.cpp" file and i press f12 to see the decleration of the function "Class_CallSimpleFunction_SanityTest" i come to the decleration in the UnitTestC project. we try to check maybe we have problem with the references but we didnt succeed. thank you!

RonenCode commented 2 years ago

we passed over the project, we started from the "UnitTest" project and we see the functions in the "COOP_C_TestProxy" project We generally understood the idea of the "COOP_C_TestProxy" project, that its neccery because "UnitTest" project must wroten in c++ and to test the coop project we need to write it in c language. we dont understand the coop project himself. thank you!

smartProgramerM commented 2 years ago

writed more tests in Branch_00ae5d6c its work!! we will be happy to get fidback if its good way to do it

YochevedKarlebach commented 2 years ago

Looks perfect! Good job! Continue...

RonenCode commented 2 years ago

I tried to clone the project to my computer and I had this problem: image what can be the problem? thank you!

adrihal commented 2 years ago

https://komodor.com/learn/how-to-fix-ssl-certificate-problem-unable-to-get-local-issuer-certificate-git-error/

YochevedKarlebach commented 2 years ago

The test look very good! After you finish them you can go on to issue 4 (You can skip issue 3 for now, like you wanted).

RonenCode commented 2 years ago

I ask again about cloning, I did what was written in the link and after that I did a new clone and this is the error message I received: fatal: Unsupported SSL backend 'channel'. Supported SSL backends: openssl schannel

I will be happy to get help, the truth is that I didn't really understand is SSL . thank you!

adrihal commented 2 years ago

You probably have SSL configured to use some backend 'channel'. I think it should be openssl, which everyone is using. It kind of diffifcult to help with this over this chats. I need to see what are you doing, local SSL configs, etc... So it requires some remote access to your PC.

adrihal commented 2 years ago

Run this on your Windows 10 command prompt:

ssh -V

You should get something like: OpenSSH_for_Windows_8.1p1, LibreSSL 3.0.2

RonenCode commented 2 years ago

I ran that command and I got this line: OpenSSH_for_Windows_7.7p1, LibreSSL 2.6.5 What does this line mean? Are these versions of something? thank you

adrihal commented 2 years ago

It means you have SSH and SSL isntalled on your PC. Try to use Windows Command prompt. and run your git clone from there. I use git for windows https://gitforwindows.org (not TortoiseGit) and I tried to follow your steps and it worked for me. It just asked to authorize with web browser GitCredentialManager.

RonenCode commented 2 years ago

we run the tests, 2 test failed, we tried to understand what the problem but we didnt understand, the faild tests are: New_WhenAllocatingBuffer_ThenReturnsRightAmountOfMemroy New_WhenAllocatingClassInstance_ThenReturnsRightAmountOfMemroy we will be happy to get explanation about them. thank you!