mirror of
https://github.com/ThrowTheSwitch/Unity.git
synced 2025-10-18 21:02:20 +08:00
Clean up conversion warnings in Fixture
Turn on -Wconversion in Makefile, fix all warnings
This commit is contained in:
@ -23,9 +23,9 @@ void tearDown(void) { /*does nothing*/ }
|
||||
static void announceTestRun(unsigned int runNumber)
|
||||
{
|
||||
UnityPrint("Unity test run ");
|
||||
UnityPrintNumber(runNumber+1);
|
||||
UnityPrintNumberUnsigned(runNumber+1);
|
||||
UnityPrint(" of ");
|
||||
UnityPrintNumber(UnityFixture.RepeatCount);
|
||||
UnityPrintNumberUnsigned(UnityFixture.RepeatCount);
|
||||
UNITY_PRINT_EOL();
|
||||
}
|
||||
|
||||
@ -45,7 +45,7 @@ int UnityMain(int argc, const char* argv[], void (*runAllTests)(void))
|
||||
UnityEnd();
|
||||
}
|
||||
|
||||
return Unity.TestFailures;
|
||||
return (int)Unity.TestFailures;
|
||||
}
|
||||
|
||||
static int selected(const char* filter, const char* name)
|
||||
@ -71,7 +71,7 @@ void UnityTestRunner(unityfunction* setup,
|
||||
const char* printableName,
|
||||
const char* group,
|
||||
const char* name,
|
||||
const char* file, int line)
|
||||
const char* file, unsigned int line)
|
||||
{
|
||||
if (testSelected(name) && groupSelected(group))
|
||||
{
|
||||
|
@ -23,7 +23,7 @@ void UnityTestRunner(unityfunction* setup,
|
||||
const char* printableName,
|
||||
const char* group,
|
||||
const char* name,
|
||||
const char* file, int line);
|
||||
const char* file, unsigned int line);
|
||||
|
||||
void UnityIgnoreTest(const char* printableName, const char* group, const char* name);
|
||||
void UnityMalloc_StartTest(void);
|
||||
|
@ -46,7 +46,7 @@ clean:
|
||||
# These extended flags DO get included before any target build runs
|
||||
CFLAGS += -Wbad-function-cast
|
||||
CFLAGS += -Wcast-qual
|
||||
#CFLAGS += -Wconversion
|
||||
CFLAGS += -Wconversion
|
||||
CFLAGS += -Wformat=2
|
||||
CFLAGS += -Wmissing-prototypes
|
||||
CFLAGS += -Wold-style-definition
|
||||
|
@ -144,7 +144,7 @@ TEST(UnityFixture, FreeNULLSafety)
|
||||
TEST_GROUP(UnityCommandOptions);
|
||||
|
||||
int savedVerbose;
|
||||
int savedRepeat;
|
||||
unsigned int savedRepeat;
|
||||
const char* savedName;
|
||||
const char* savedGroup;
|
||||
|
||||
|
@ -22,7 +22,7 @@ void UnityOutputCharSpy_Create(int s)
|
||||
size = s;
|
||||
count = 0;
|
||||
spy_enable = 0;
|
||||
buffer = malloc(size);
|
||||
buffer = malloc((size_t)size);
|
||||
TEST_ASSERT_NOT_NULL_MESSAGE(buffer, "Internal malloc failed in Spy Create():" __FILE__);
|
||||
memset(buffer, 0, size);
|
||||
}
|
||||
@ -38,7 +38,7 @@ int UnityOutputCharSpy_OutputChar(int c)
|
||||
if (spy_enable)
|
||||
{
|
||||
if (count < (size-1))
|
||||
buffer[count++] = c;
|
||||
buffer[count++] = (char)c;
|
||||
}
|
||||
else
|
||||
{
|
||||
|
Reference in New Issue
Block a user