mirror of
https://github.com/google/googletest.git
synced 2025-12-06 08:46:50 +08:00
Add ABI-compatible overload for MakeAndRegisterTestInfo to fix v1.14.0 linker errors (#1)
* Add backward-compatible overload for MakeAndRegisterTestInfo Co-authored-by: kairosci <226562783+kairosci@users.noreply.github.com> * Complete fix with verification and testing Co-authored-by: kairosci <226562783+kairosci@users.noreply.github.com> * Remove CodeQL build artifacts and update gitignore Co-authored-by: kairosci <226562783+kairosci@users.noreply.github.com> --------- Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: kairosci <226562783+kairosci@users.noreply.github.com>
This commit is contained in:
parent
ffb6156362
commit
409017ae98
1
.gitignore
vendored
1
.gitignore
vendored
@ -87,3 +87,4 @@ googlemock/gtest
|
||||
/CMakeCache.txt
|
||||
/ALL_BUILD.vcxproj.filters
|
||||
/ALL_BUILD.vcxproj
|
||||
_codeql_*
|
||||
|
||||
@ -561,6 +561,15 @@ GTEST_API_ TestInfo* MakeAndRegisterTestInfo(
|
||||
TypeId fixture_class_id, SetUpTestSuiteFunc set_up_tc,
|
||||
TearDownTestSuiteFunc tear_down_tc, TestFactoryBase* factory);
|
||||
|
||||
// Backward-compatible overload for ABI compatibility with v1.14.0 and earlier.
|
||||
// This version takes const char* instead of std::string to avoid ABI issues
|
||||
// when passing std::string by value across library boundaries.
|
||||
GTEST_API_ TestInfo* MakeAndRegisterTestInfo(
|
||||
const char* test_suite_name, const char* name, const char* type_param,
|
||||
const char* value_param, CodeLocation code_location,
|
||||
TypeId fixture_class_id, SetUpTestSuiteFunc set_up_tc,
|
||||
TearDownTestSuiteFunc tear_down_tc, TestFactoryBase* factory);
|
||||
|
||||
// If *pstr starts with the given prefix, modifies *pstr to be right
|
||||
// past the prefix and returns true; otherwise leaves *pstr unchanged
|
||||
// and returns false. None of pstr, *pstr, and prefix can be NULL.
|
||||
|
||||
@ -2829,6 +2829,19 @@ TestInfo* MakeAndRegisterTestInfo(
|
||||
return test_info;
|
||||
}
|
||||
|
||||
// Backward-compatible overload for ABI compatibility with v1.14.0 and earlier.
|
||||
TestInfo* MakeAndRegisterTestInfo(
|
||||
const char* test_suite_name, const char* name, const char* type_param,
|
||||
const char* value_param, CodeLocation code_location,
|
||||
TypeId fixture_class_id, SetUpTestSuiteFunc set_up_tc,
|
||||
TearDownTestSuiteFunc tear_down_tc, TestFactoryBase* factory) {
|
||||
// Forward to the std::string version
|
||||
return MakeAndRegisterTestInfo(std::string(test_suite_name), name, type_param,
|
||||
value_param, std::move(code_location),
|
||||
fixture_class_id, set_up_tc, tear_down_tc,
|
||||
factory);
|
||||
}
|
||||
|
||||
void ReportInvalidTestSuiteType(const char* test_suite_name,
|
||||
const CodeLocation& code_location) {
|
||||
Message errors;
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user