unittests: Start simplifying test structure

* Rework ByteOrderTest and DateTimeTest to use autoregistration.
* Functional changes in ByteOrderTest are confirmed in git history
  to be R5 compatibility fixes. This doesn't include B_ASCII_TYPE -
  it seems it has never been part of is_type_swapped().
* Autoregistered test names start with a number - this is because
  RTTI is used to create them. Disabling RTTI is not an option
  because CppUnit in our repo has a broken macro which always sets
  the name to "ATestFixtureType". This is probably fixed in newer
  CppUnit versions.

Change-Id: I56ab5df6e998b6f47fca3c3458a56a761c1740a8
Reviewed-on: https://review.haiku-os.org/c/haiku/+/10266
Reviewed-by: waddlesplash <[email protected]>
Tested-by: Commit checker robot <[email protected]>
Reviewed-by: Kacper Kasper <[email protected]>
This commit is contained in:
Kacper Kasper
2026-02-20 19:31:36 +00:00
parent 4c6b9f88fe
commit dc8424dd5e
11 changed files with 336 additions and 465 deletions
+4 -1
View File
@@ -4,6 +4,7 @@
#include <LockerSyncObject.h>
#include <cppunit/Exception.h>
#include <cppunit/Test.h>
#include <cppunit/TestSuite.h>
#include <cppunit/TestListener.h>
#include <cppunit/TestResult.h>
#include <cppunit/TestResultCollector.h>
@@ -61,6 +62,8 @@ public:
// the list of tests via a call to AddTest(string
status_t AddSuite(BTestSuite *kit);
status_t AddSuite(CppUnit::TestSuite *suite);
// This function is used to add test suites to the list of available
// tests. The test pointer may not be NULL. The name given is the name that
// will be presented when the program is run with "--list" as an argument.
@@ -107,7 +110,7 @@ public:
protected:
typedef std::map<std::string, CppUnit::Test*> TestMap;
typedef std::map<std::string, BTestSuite*> SuiteMap;
typedef std::map<std::string, CppUnit::TestSuite*> SuiteMap;
VerbosityLevel fVerbosityLevel;
std::set<std::string> fTestsToRun;