I’m quit new to this forum and couldn’t find a better category and any Bug report related to the issue I’ve found.
On compiling a Unit Test class containing a test function with the form
expectEquals(uint32_t, uint32_t, juce::String)
generates the following compiler error:
..../JUCE/modules/juce_core/unit_tests/juce_UnitTest.h:295:55 Use of overloaded operator '<<' is ambiguous (with operand types 'juce::String' and 'unsigned int')
MacOS (MacBook Air with M2, Ventura 13.0)
Projucer / Juce version: 7.0.3
macOS Deployment Target configured: 10.15
xCode (Version 14.2) is used as generated by Projucer
December 20, 2022, 9:41am
Maybe you could post the offending line of code??
The called function looks like this
expectEquals(handler->IndexA, (uint32_t)0xDE002200, "Assert: Handler Index A was updated");
where handler is a struct that contains IndexA as uint32_t variable. Adding casts at any position has no effect on the compiler error.
The compiler error message leads to the following code section:
juce_UnitTest.h line 285
template <class ValueType>
void expectResultAndPrint (ValueType value, ValueType valueToCompareTo, bool result,
String compDescription, String failureMessage)
if (! result)
failureMessage << " -- ";
failureMessage << "Expected value" << (compDescription.isEmpty() ? "" : " ")
<< compDescription << ": " << valueToCompareTo
<< ", Actual value: " << value;
expect (result, failureMessage);
More precise is the following << operator call mentioned in the compiler error message
": " << valueToCompareTo
December 20, 2022, 2:12pm
there’s a bool parameter there that you’re passing a string into:
ValueType value, ValueType valueToCompareTo,
The function causing the error is NOT the function I am calling as you can see in the two code snippets I’ve posted. The function causing the error is called somewhere within JUCE during the processing of the function I’ve called within my test class
December 20, 2022, 2:35pm
yeah, sorry, was looking at wrong bit of code.