mirror of
https://github.com/ThrowTheSwitch/Unity.git
synced 2026-10-01 22:47:22 +00:00
Merge pull request #183 from xor-gate/master
Fix #182, remove redundant function declarations (Thanks xor-gate!)
This commit is contained in:
+5
-8
@@ -7,6 +7,11 @@
|
|||||||
#include "unity.h"
|
#include "unity.h"
|
||||||
#include <stddef.h>
|
#include <stddef.h>
|
||||||
|
|
||||||
|
#ifndef UNITY_OUTPUT_CHAR_USE_PUTC
|
||||||
|
//If defined as something else, make sure we declare it here so it's ready for use
|
||||||
|
extern int UNITY_OUTPUT_CHAR(int);
|
||||||
|
#endif
|
||||||
|
|
||||||
#define UNITY_FAIL_AND_BAIL { Unity.CurrentTestFailed = 1; longjmp(Unity.AbortFrame, 1); }
|
#define UNITY_FAIL_AND_BAIL { Unity.CurrentTestFailed = 1; longjmp(Unity.AbortFrame, 1); }
|
||||||
#define UNITY_IGNORE_AND_BAIL { Unity.CurrentTestIgnored = 1; longjmp(Unity.AbortFrame, 1); }
|
#define UNITY_IGNORE_AND_BAIL { Unity.CurrentTestIgnored = 1; longjmp(Unity.AbortFrame, 1); }
|
||||||
/// return prematurely if we are already in failure or ignore state
|
/// return prematurely if we are already in failure or ignore state
|
||||||
@@ -67,9 +72,6 @@ const _U_UINT UnitySizeMask[] =
|
|||||||
#endif
|
#endif
|
||||||
};
|
};
|
||||||
|
|
||||||
void UnityPrintFail(void);
|
|
||||||
void UnityPrintOk(void);
|
|
||||||
|
|
||||||
//-----------------------------------------------
|
//-----------------------------------------------
|
||||||
// Pretty Printers & Test Result Output Handlers
|
// Pretty Printers & Test Result Output Handlers
|
||||||
//-----------------------------------------------
|
//-----------------------------------------------
|
||||||
@@ -1261,8 +1263,6 @@ void UnityIgnore(const char* msg, const UNITY_LINE_TYPE line)
|
|||||||
|
|
||||||
//-----------------------------------------------
|
//-----------------------------------------------
|
||||||
#if defined(UNITY_WEAK_ATTRIBUTE)
|
#if defined(UNITY_WEAK_ATTRIBUTE)
|
||||||
void setUp(void);
|
|
||||||
void tearDown(void);
|
|
||||||
UNITY_WEAK_ATTRIBUTE void setUp(void) { }
|
UNITY_WEAK_ATTRIBUTE void setUp(void) { }
|
||||||
UNITY_WEAK_ATTRIBUTE void tearDown(void) { }
|
UNITY_WEAK_ATTRIBUTE void tearDown(void) { }
|
||||||
#elif defined(UNITY_WEAK_PRAGMA)
|
#elif defined(UNITY_WEAK_PRAGMA)
|
||||||
@@ -1270,9 +1270,6 @@ void UnityIgnore(const char* msg, const UNITY_LINE_TYPE line)
|
|||||||
void setUp(void) { }
|
void setUp(void) { }
|
||||||
# pragma weak tearDown
|
# pragma weak tearDown
|
||||||
void tearDown(void) { }
|
void tearDown(void) { }
|
||||||
#else
|
|
||||||
void setUp(void);
|
|
||||||
void tearDown(void);
|
|
||||||
#endif
|
#endif
|
||||||
//-----------------------------------------------
|
//-----------------------------------------------
|
||||||
void UnityDefaultTestRun(UnityTestFunction Func, const char* FuncName, const int FuncLineNum)
|
void UnityDefaultTestRun(UnityTestFunction Func, const char* FuncName, const int FuncLineNum)
|
||||||
|
|||||||
@@ -291,9 +291,12 @@ typedef UNITY_DOUBLE_TYPE _UD;
|
|||||||
//Default to using putchar, which is defined in stdio.h
|
//Default to using putchar, which is defined in stdio.h
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#define UNITY_OUTPUT_CHAR(a) putchar(a)
|
#define UNITY_OUTPUT_CHAR(a) putchar(a)
|
||||||
#else
|
// We need to flag the output char function uses putc in
|
||||||
//If defined as something else, make sure we declare it here so it's ready for use
|
// unity.c the extern function is not declared then.
|
||||||
extern int UNITY_OUTPUT_CHAR(int);
|
// Previously the extern was declared in this header but
|
||||||
|
// when redundant function declaration compiler flag is enabled
|
||||||
|
// it wont compile.
|
||||||
|
#define UNITY_OUTPUT_CHAR_USE_PUTC
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifndef UNITY_PRINT_EOL
|
#ifndef UNITY_PRINT_EOL
|
||||||
|
|||||||
+1
-1
@@ -3,7 +3,7 @@ ifeq ($(shell uname -s), Darwin)
|
|||||||
CC = clang
|
CC = clang
|
||||||
endif
|
endif
|
||||||
#DEBUG = -O0 -g
|
#DEBUG = -O0 -g
|
||||||
CFLAGS += -std=c99 -pedantic -Wall -Wextra -Werror
|
CFLAGS += -std=c99 -pedantic -Wall -Wextra -Werror -Wredundant-decls
|
||||||
CFLAGS += $(DEBUG)
|
CFLAGS += $(DEBUG)
|
||||||
DEFINES = -D UNITY_OUTPUT_CHAR=putcharSpy -D UNITY_INCLUDE_DOUBLE
|
DEFINES = -D UNITY_OUTPUT_CHAR=putcharSpy -D UNITY_INCLUDE_DOUBLE
|
||||||
SRC = ../src/unity.c tests/testunity.c build/testunityRunner.c
|
SRC = ../src/unity.c tests/testunity.c build/testunityRunner.c
|
||||||
|
|||||||
@@ -8,6 +8,8 @@
|
|||||||
#include "unity.h"
|
#include "unity.h"
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
|
|
||||||
|
int putcharSpy(int c);
|
||||||
|
|
||||||
// Dividing by these constants produces +/- infinity.
|
// Dividing by these constants produces +/- infinity.
|
||||||
// The rationale is given in UnityAssertFloatIsInf's body.
|
// The rationale is given in UnityAssertFloatIsInf's body.
|
||||||
#ifndef UNITY_EXCLUDE_FLOAT
|
#ifndef UNITY_EXCLUDE_FLOAT
|
||||||
|
|||||||
Reference in New Issue
Block a user