Jump to content

Roger Cigol

  • Content Count

  • Joined

  • Last visited

  • Days Won


Everything posted by Roger Cigol

  1. Roger Cigol

    Survey of Delphi Versions in use??

    something like this https://doodle.com/poll/d9hd42sisyemqbyu
  2. Did it compile ok (all files) and then give this message when trying to link ? Can you state with version of C++ Builder you are using (hopefully Alexandria 11.1). ?
  3. Has anyone got Google Tests (unit testing framework) working with Embarcadero C++ clang compiler? if so, using clang32 or clang64 bit? [or, ideally, both?] I can't find any web documentation that tells me if this is currently possible (Embarcadero 10.4.1) or not. (If there is a helpful URL then I would be grateful if anyone can oblige).
  4. GoogleTests has lots of ASSERT_xxxx type functions to cover most common (and indeed uncommon) C++ types. But it doesn’t know about the Embarcadero String type. To make it easy and consistent to do Embarcadero String types I have made a simple C++ unit which I have called ASSERT_STRING_EQ. I simply include ASSERT_STRING_EQ.h at the top of googletest files that require comparisons of String types and make sure ASSERT_STRING_EQ.cpp is added to the project file. The contents of ASSERT_STRING_EQ.cpp is as follows: void ASSERT_STRING_EQ(String A, String B) { ASSERT_STREQ(A.c_str(), B.c_str()); } void ASSERT_STRING_NE(String A, String B) { ASSERT_STRNE(A.c_str(), B.c_str()); }
  5. Your first point may be to read the posting on Delphipraxis below. Around July 2021 there is a link to my blog about using google tests with 10.4.2. (and later a link to my blog about using it with 11.1). I did get it to work ok with 10.4.2 - be aware that the packages as downloaded by getit come with some of the projects set to clang32 and some set to clang64 (a mess - might have been fixed by now, but unlikely) so before you try to build all the packages downloaded by getit you need to manually set them all to clang32 or clang64 according to which you want to use. I have a licensed version of RAD Studio but I don't see any reason why you can't get it to work with 10.4.2 community edition. Be aware also that it never did work with 11.0 ! - but all is good with 11.1 It's always wise to search DelphiPraxis before posting as you may find (as in this case) that your question has already been answered. Also it's best to post C++ related questions in the C++ section of DelphiPraxis. Hope this helps....
  6. In your unit test project you also need to include the *.cpp "modules" that you are going to test. As soon as you add these to the unit test project the compiler will know where to find the corresponding header file.
  7. OK - For the sake of other forum users <ie so the DUnit discussion is not here under a google test heading> I suggest you post a new posting in Praxis C++ Builder section with a title "can't get DUnit Tests to run with Classic Compiler" or something similar (better!) and then post details of your problem. I will try to help (but make no promises !)
  8. I should add that the DUnit test framework comes as part of C++ Builder
  9. You can't use googletest with the classic compiler. GoogleTest requires at least C++11 support (I think). It definitely will not compile with the classic compiler. For classic compiler you need to use the DUnit test framework. This is a little limited but it works very well and reliably.
  10. I don't know R at all. But looking at your code it's all fairly clear what's going on (<- is the same as delphi := [took me 30s to work this out]). Your key challenge is to make sure you select the correct types for the variables used. I am a strong advocate of writing readable (and hence supportable) code. I would respectfully suggest that you use longer, more meaningful names for the function and for the variables it uses. This would make it much much easier to see what the function does and how it does it.
  11. There were some reported issues with the web install process. Repeat of installation does sometimes solve it. Installing from the iso avoids this problem - download the iso - extract and install. But there is a possible danger: Embarcadero recommend installing 11.1 using the same method as 11.0 (I believe) so if you used the Web Install for 11.0 it may be wise to use web install for 11.1. I own up to using the iso as my preferred install method - you can download the iso whilst doing something useful elsewhere and then once you start the install you know you are free of any internet connection issues causing a problem.
  12. I have now added my further blog that explains how I am actually using googleTests on a working (or at least on going development) clang 64 VCL C++ Builder project (using RAD Studio 11.1) https://cigolblog.wordpress.com/2022/03/25/tips-for-using-googletests-with-embarcadero-clang64-for-windows-vcl-projects-2/
  13. Roger Cigol

    Trial RAD 11 expired Delphi CE is 10.x

    ...and the version of CE does tend to lag behind the latest release, too
  14. Roger Cigol

    code completion?

    In 11.1 a new VCL project defaults to clang32 (not classic). and I, for one, am an enthusiastic professional C++ programmer who uses Embarcadero RAD Studio 11.1. It is true there is a "balance" between the classic compiler and clang compiler for Win32 VCL applications. Once you have used C++ 17 it is very painful to go back to the restrictions of the classic compiler though.....
  15. Roger Cigol

    Delphi 11.1 is available

    I downloaded the ISO and successfully ran a problem free install of RAD Studio 11.1 from the iso.
  16. Roger Cigol

    Delphi 11.1 is available

    I enjoy being an MVP and benefit greatly from conversing with esteemed colleagues, many of whom are much more experienced and widely knowledgeable than me. I keep a track of all the time I spend on MVP related tasks. At my standard programming hourly rate I spend significantly more time on MVP work than the cost of the annual subscription for "RAD Studio Enterprise". So yes, @Uwe Raabeis correct it does come with "some obligations".
  17. Roger Cigol

    Delphi 11.1 Crash on Search Menu Access

    This works fine (both Find... and Find in files...) using highlighted text for C++ files running 11.1 under windows 10. Difficult to imagine why it should be different on Windows 11, so lets see if anyone else has the same issue....
  18. Great news : Google Tests all looks good for 11.1. I've blogged about how to get it up and running... https://cigolblog.wordpress.com/2022/03/17/using-googletests-with-embarcadero-clang64-for-windows-vcl-projects-c-builder-11-1/ I will add a further blog in the next few days about how I like to use it for testing my Clang64bit projects.
  19. Roger Cigol

    Migration Tool (11 --> 11.1)

    I too selected "option 2" and all the registry entries seem to have persisted. My (limited) use of 11.1 makes me feel it is a great improvement over 11.0
  20. I have several tables that I want to completely empty. My plan was to use a single TFDQuery and to set (at design time) the SQL to DELETE FROM :tablename and then to set the :tablename parameter to type ptInput and datatype to ftString. Then I planned to call this query for each table, having set the parameter to the table name. But it doesn't work, each call to Execute() (following the setting of the parameter to the required table name) gives an exception. I am using a 64bit PostgreSQL database so I can't test the parameter query at design time (can't connect from a 32 bit app). If I query my database directly using a query tool I can enter DELETE FROM MyTable and all the contents of MyTable disappear as required. I also find that the following code works (I am using C++ clang 64 in Alexandria 11.0): auto SQL(std::make_unique<TStringList>()); SQL->Clear(); SQL->Add(String("DELETE FROM ") + DestinationTableName); DestinationDeleteAllFDQuery->Close(); DestinationDeleteAllFDQuery->SQL->Text = SQL->Text; DestinationDeleteAllFDQuery->OpenOrExecute(); My question is : Is this expected behaviour? ie Is it known that parameters in FireDAC queries can not used to pass table names ?
  21. Roger Cigol

    FireDAC TFDQuery - table names as parameters

    This "generalisation" of FireDAC to suit the very many supported databases is one of it's great features. It is worth using approaches that continue/extend this generalisation primarily because it allows re-use of your code in other applications (that could be using different databases). As it happens the job that led to my question is actually migrating a working-well-for-many-years system that uses MS Access to a 64 bit application using PostgreSQL. The fact that the MS Access system uses FireDAC makes this task so much more straightforward.
  22. Roger Cigol

    Comport Serial Port help

    What you are really asking is "how to convert data in a string of a particular format" into a binary integer. But you are asking this question without giving us the actual string. So with the code where you "get the correct string" - what string do you get? maybe offer a few examples with different inputs on the ADC.
  23. Roger Cigol

    'Floating point division by zero' when running script

    Hi @David Heffernan, My pondering continued (and continues). Can you confirm that I am correct in concluding that it is the application (ie task) responsibility to maintain the correct FPU exception settings amongst threads it uses but it is the operating system's responsibility to maintain the FPU settings when process time is switched from one task to another. If this is the case then this makes sense to me and explains why applying the fixes so well outlined in your pdf would make a lot of sense.
  24. Roger Cigol

    'Floating point division by zero' when running script

    [pdf] That's a very interesting read, thank you I think your statement about what you do to the floating point control state is what I am trying to achieve with my use of the two SetExceptions() calls.
  25. Roger Cigol

    'Floating point division by zero' when running script

    I am very worried by David H's posting here. But also this could explain an issue I've had on a system for a long time that calls a 3rd party dll that I suspect creates it's own threads. This seems to at random times generate unexpected windows "exception" messages. The documentation at https://docwiki.embarcadero.com/RADStudio/Alexandria/en/About_Floating-Point_Arithmetic is pretty good at telling you HOW to change floating point exceptions but not at all clear at what to set them to! Do you recommend when calling external 3rd party dlls that you make a call to SetExceptions() with a value of zero, storing the result (the current settings) into some local variable) before calling the 3rd party dll and then a call to SetExceptions passing the value saved in the local value as soon as the dll completes ? You may well choose to answer as an experienced Delphi programmer - any advice for me writting in C++ (using classic,, clang32 and clang64 compilers for different apps) would be welcome too. Thinking about the mulit-threading floating point interaction, surely the only way to achieve this would be to make sure the floating point unit is correctly configured before every floating point operation - a major overhead. I am still pondering this....