easyfmxu / cmockery Goto Github PK
View Code? Open in Web Editor NEWAutomatically exported from code.google.com/p/cmockery
Automatically exported from code.google.com/p/cmockery
What steps will reproduce the problem?
1. Compile on LP64 platform such as Mac OS X or Linux on x86_64
2. Observe warning messages.
What is the expected output?
No warnings.
What do you see instead?
/Users/smb/src/cmockery-staging/osx/../src/cmockery.c: In function
'mock_assert':
/Users/smb/src/cmockery-staging/osx/../src/cmockery.c:1232: warning: cast from
pointer to
integer of different size
What version of the product are you using? On what operating system?
Please provide any additional information below.
Original issue reported on code.google.com by [email protected]
on 2 Mar 2010 at 1:51
When trying to run allocate_module_test, it fails. Is this the expected
output? Are other tests expected to fail?
$ ./allocate_module_test
leak_memory_test: Starting test
Blocks allocated...
0x0804a0c8 : src/example/allocate_module.c:30
ERROR: leak_memory_test leaked 1 block(s)
leak_memory_test: Test failed.
buffer_overflow_test: Starting test
Guard block of 0x0804a100 size=4 allocated by
src/example/allocate_module.c:35 a t 0x0804a104 is corrupt
ERROR: src/example/allocate_module.c:37 Failure!
buffer_overflow_test: Test failed.
buffer_underflow_test: Starting test
Guard block of 0x0804a150 size=4 allocated by
src/example/allocate_module.c:41 a t 0x0804a14f is corrupt
ERROR: src/example/allocate_module.c:43 Failure!
buffer_underflow_test: Test failed.
3 out of 3 tests failed!
leak_memory_test
buffer_overflow_test
buffer_underflow_test
Blocks allocated...
0x0804a0c8 : src/example/allocate_module.c:35
0x0804a118 : src/example/allocate_module.c:41
Guard block of 0x0804a100 size=4 allocated by
src/example/allocate_module.c:35 a t 0x0804a104 is corrupt
ERROR: src/cmockery.c:1379 Failure!
What steps will reproduce the problem?
1. ./configure
2. make
3. ./allocate_module_test
What is the expected output? What do you see instead?
I expected no test failures. If this is an expected failure, that'd be
great to know.
What version of the product are you using? On what operating system?
This is on debian 4.1 with the following gcc -v
$ gcc -v
Using built-in specs.
Target: i486-linux-gnu
Configured with: ../src/configure -v
--enable-languages=c,c++,fortran,objc,obj-c++,treelang --prefix=/usr
--enable-shared --with-system-zlib --libexecdir=/usr/lib
--without-included-gettext --enable-threads=posix --enable-nls
--program-suffix=-4.1 --enable-__cxa_atexit --enable-clocale=gnu
--enable-libstdcxx-debug --enable-mpfr --with-tune=i686
--enable-checking=release i486-linux-gnu
Thread model: posix
gcc version 4.1.2 20061115 (prerelease) (Debian 4.1.1-21)
Please provide any additional information below.
I have a port of cmocker to OS X that fails in this same way.
Original issue reported on code.google.com by [email protected]
on 28 Jan 2009 at 5:25
What steps will reproduce the problem?
1. Create the simple test first_test.c:
#include <stdarg.h>
#include <stddef.h>
#include <setjmp.h>
#include "cmockery.h"
void main(void) {}
2. Put cmockery.h and cmockery.c to the same directory
3. Compile it: cl /I. first_test.c cmockery.c
What is the expected output? What do you see instead?
Visual Studio 2003:
Microsoft (R) 32-bit C/C++ Optimizing Compiler Version 13.10.3077 for 80x86
Copyright (C) Microsoft Corporation 1984-2002. All rights reserved.
first_test.c
cmockery.c
Generating Code...
Microsoft (R) Incremental Linker Version 7.10.3077
Copyright (C) Microsoft Corporation. All rights reserved.
/out:first_test.exe
first_test.obj
cmockery.obj
cmockery.obj : error LNK2019: unresolved external symbol IsDebuggerPresent
referenced in function __run_test
first_test.exe : fatal error LNK1120: 1 unresolved externals
Visual Studio 2005:
Microsoft (R) 32-bit C/C++ Optimizing Compiler Version 14.00.50727.762 for
80x86
Copyright (C) Microsoft Corporation. All rights reserved.
first_test.c
cmockery.c
Generating Code...
Microsoft (R) Incremental Linker Version 8.00.50727.762
Copyright (C) Microsoft Corporation. All rights reserved.
/out:first_test.exe
first_test.obj
cmockery.obj
cmockery.obj : error LNK2019: unresolved external symbol _IsDebuggerPresent
refe
renced in function __run_test
first_test.exe : fatal error LNK1120: 1 unresolved externals
Visual Studio 2008:
Microsoft (R) 32-bit C/C++ Optimizing Compiler Version 15.00.21022.08 for 80x86
Copyright (C) Microsoft Corporation. All rights reserved.
first_test.c
cmockery.c
Generating Code...
Microsoft (R) Incremental Linker Version 9.00.21022.08
Copyright (C) Microsoft Corporation. All rights reserved.
/out:first_test.exe
first_test.obj
cmockery.obj
What version of the product are you using? On what operating system?
- cmockery 0.1.2
- Visual Studio 2003, 2005 SP1, 2008
- Windows XP SP3
Please provide any additional information below.
Conclusion: Only starting from Visual Studio 2008 the function
IsDebuggerPresent() is declared in headers.
I use the following patch which explicitly declares the function
IsDebuggerPresent() for Visual Studio 2005 and lower:
--- a/cmockery.h Sat Dec 13 17:39:25 2008
+++ b/cmockery.h Sat Dec 13 19:07:44 2008
@@ -15,19 +15,6 @@
*/
#ifndef CMOCKERY_H_
#define CMOCKERY_H_
-
-#ifdef _WIN32
-#if _MSC_VER < 1500
-#ifdef __cplusplus
-extern "C" {
-#endif
-int __stdcall IsDebuggerPresent();
-#ifdef __cplusplus
-} /* extern "C" */
-#endif
-#endif
-#endif
-
/*
* These headers or their equivalents should be included prior to including
* this header file.
Original issue reported on code.google.com by [email protected]
on 13 Dec 2008 at 7:41
Built on AMD64 SuSE 9.4, 75 warnings generated (make stderr attached)
> uname -a
Linux lx3-kdb-sng 2.6.5-7.312-smp #1 SMP Fri Jun 6 13:44:33 UTC 2008 x86_64
x86_64 x86_64 GNU/Linux
> cat /etc/SuSE-release
SUSE LINUX Enterprise Server 9 (x86_64)
VERSION = 9
PATCHLEVEL = 4
Original issue reported on code.google.com by [email protected]
on 16 Sep 2008 at 3:18
Attachments:
What steps will reproduce the problem?
Below steps throw's Guard block error which I expect it shouldn't.
void leak_memory() {
int * temporary = (int*)realloc(NULL, sizeof(int));
temporary = (int *) realloc (temporary, (10 * sizeof (int)));
free (temporary);
}
What is the expected output? What do you see instead?
Expected :-
===========
Allocated memory by realloc function should be free'd and test case should
pass.
Output Seen:-
=======================================================================
leak_memory_test: Starting test
Guard block of 0x00501120 size=0 allocated by :5247040 at 0x00501118 is
corrupt
ERROR: src/example/allocate_module.c:33 Failure!
leak_memory_test: Test failed.
1 out of 1 tests failed!
leak_memory_test
=======================================================================
What version of the product are you using? On what operating system?
Product version -
=============
cmockery-0.1.2
Operating System -
====================
ukhml-bladeAS4-~/mywork/cmockery-0.1.2/src/example: uname -a
Linux ukhml-bladeAS4 2.6.9-89.0.11.ELsmp #1 SMP Mon Aug 31 11:00:34 EDT
2009 x86_64 x86_64 x86_64 GNU/Linux
ukhml-bladeAS4-~/mywork/cmockery-0.1.2/src/example:
====================
Please provide any additional information below.
In my actual unit test case, program flow calls these below functions in
sequence which result in guard block error -
step
1.) malloc
2.) realloc and
3.) free.
Only work around I could do was just replace all such calls to
corresponding calls of realloc function for initial request to memory, re-
sizing memory and for freeing memory which overcame this error.
I was not able to re-produce with this sequence in an independent program.
Instead a sequence of realloc and free helped in reproducing this error
message which I mentioned above.
Is it something that realloc is not monitored by comockery ?
Thanks & Regards.,
Naveen Sriram.
Original issue reported on code.google.com by [email protected]
on 22 Mar 2010 at 1:42
What steps will reproduce the problem?
1. Compile cmockery on Mac OS Leopard
What is the expected output? What do you see instead?
When running "./configure && make", it errors out saying that "malloc.h" can
not be found (log
attached as "plain-configure.log"). On Mac OS there are at least 3 different
"malloc.h" files:
$ find /usr/include -name "malloc.h"
/usr/include/malloc/malloc.h
/usr/include/objc/malloc.h
/usr/include/sys/malloc.h
Apparently "/usr/include/sys/malloc.h" is the one to use. Thus I attempted to compile cmockery
by issueing the following command:
"CFLAGS="-I/usr/include/sys" ./configure && make
That got me further, but size_t does not appear to be defined.
According to stdlib.h, size_t is defined as:
typedef __darwin_size_t size_t;
Output of the build process is attached as "cflags-configure.log".
What version of the product are you using? On what operating system?
cmockery 0.1.2, Mac OS Leopard (10.5.4)
Original issue reported on code.google.com by [email protected]
on 14 Oct 2008 at 1:00
Attachments:
What steps will reproduce the problem?
1. Open http://cmockery.googlecode.com/svn/trunk/doc/index.html#Mock_Functions
2. Observe the fail_connect_to_customer_database() source and note that it
won't fail as the comment explains, because it includes a will_return() call
3. Compare that to
http://code.google.com/p/cmockery/source/browse/trunk/src/example/customer_datab
ase_test.c?r=42, which doesn't include the will_return() call
What version of the product are you using?
0.1.2
Index: index.html
===================================================================
--- index.html (revision 42)
+++ index.html (working copy)
@@ -466,7 +466,6 @@
/* This test fails as the mock function connect_to_database() will have no
* value to return. */
void fail_connect_to_customer_database(void **state) {
- will_return(connect_to_database, 0x0DA7ABA53);
assert_true(connect_to_customer_database() ==
(DatabaseConnection*)0x0DA7ABA53);
}
Original issue reported on code.google.com by [email protected]
on 4 Jan 2011 at 7:14
What steps will reproduce the problem?
1. gcc/g++ warns when compiling cmockery.c with some options such as -Wall
What is the expected output? What do you see instead?
no output
What version of the product are you using? On what operating system?
version: svn r.42
system: Windows XP SP3
compiler: gcc 3/4 and g++3/4 in mingw
Please provide any additional information below.
with this patch, we clean the warnings when
gcc -c -std=c99 -O6 -Os -Wall -Wextra -Werror -pedantic
g++ -c -O6 -Os -Wall -Wextra -Werror
Original issue reported on code.google.com by [email protected]
on 25 Nov 2009 at 6:44
Attachments:
What steps will reproduce the problem?
1. create the following unit test of cmockery:
/***
* @unit_test assert_in_range with signed int.
*/
void test_assert_in_range_signed_int(void **state) {
int value;
int lower_bound;
int upper_bound;
value = INT_MIN;
lower_bound = INT_MIN;
upper_bound = INT_MAX;
fprintf(stderr, " lower bound: %d upper bound: %d \n",
lower_bound, upper_bound);
assert_in_range(value, lower_bound, upper_bound);
value = INT_MAX;
assert_in_range(value, lower_bound, upper_bound);
value = 0;
assert_in_range(value, lower_bound, upper_bound);
}
2. Compile and run on i386
3. Observe output:
[ RUN ] test_assert_in_range_signed_int
lower bound: -2147483648 upper bound: 2147483647
-2147483648 is not within the range 0--2147483648
ERROR: /Users/smb/src/cmockery-staging/osx/../src/unit_test/unit_test.c:235
Failure!
Note that the bounds on the range are odd.
What is the expected output? What do you see instead?
Fixing the printf format specification string in
integer_in_range_display_error() to reflect the
actual size and type of the arguments (unsigned long longs) gives a better
diagnosis of the
problem. Changing the print_error() call to:
print_error("%llu is not within the range %llu-%llu\n", value, range_min,
range_max);
gives us this on i386:
[ RUN ] test_assert_in_range_signed_int
lower bound: -2147483648 upper bound: 2147483647
2147483648 is not within the range 2147483648-2147483647
ERROR: /Users/smb/src/cmockery-staging/osx/../src/unit_test/unit_test.c:235
Failure!
What version of the product are you using? On what operating system?
Please provide any additional information below.
There are many other cases beside the integer_in_range_display_error() function
where the printf
format specification assumes a non-portable size. Other examples include
printing pointers and
size_t.
Original issue reported on code.google.com by [email protected]
on 2 Mar 2010 at 1:23
I've noticed some warnings related with an "incorrect" use of printf and
derivates. Could you fix that issue aplying the next patch?
1535c1535
< puts(buffer);
---
> printf(buffer);
1545c1545
< fputs(buffer, stderr);
---
> fprintf(stderr, buffer);
Original issue reported on code.google.com by [email protected]
on 7 Mar 2010 at 2:39
Below is a patch to allow building of cmockery outside of the source
directory.
It has been tested against subversion trunk, and passes 'make distcheck'.
Signed-off-by: Chris Heller <[email protected]>
--- cmockery-20081023/Makefile.am 2008-10-23 23:31:02.000000000 -0400
+++ cmockery-out-of-source-tree/Makefile.am 2008-10-23
23:32:28.000000000 -0400
@@ -46,13 +46,13 @@
lib_LTLIBRARIES += libcmockery.la
libcmockery_la_SOURCES = src/config.h src/cmockery.c src/google/cmockery.h
-libcmockery_la_CFLAGS = -Isrc/google
+libcmockery_la_CFLAGS = -I$(top_srcdir)/src/google
noinst_PROGRAMS = calculator
calculator_SOURCES = src/example/calculator.c src/config.h
calculator_CFLAGS =
-unit_test_CFLAGS = -Isrc/google -Isrc/example -DUNIT_TESTING=1
+unit_test_CFLAGS = -I$(top_srcdir)/src/google -I$(top_srcdir)/src/example
-DUNIT_TESTING=1
noinst_PROGRAMS += calculator_test
calculator_test_SOURCES = src/example/calculator_test.c \
Original issue reported on code.google.com by [email protected]
on 24 Oct 2008 at 3:54
When I call assert_in_set() with a value of '1' and an enumeration array as the
set (0-12), I get the
following error:
"1 is not in the set (0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, )"
Calling assert_in_set() will call value_in_set_display_error() with invert=0.
It looks like there's something wrong with the "invert" logic.
As soon as set[i] == value (e.g. 1 == 1), the 'for' loop breaks, but
then rather than return success, it prints the error message and
returns failure.
Original issue reported on code.google.com by [email protected]
on 9 Jan 2009 at 8:21
What steps will reproduce the problem?
1. Call _test_free with the first argument set to 0 or NULL
2. _test_free asserts that ptr must not be null
3. testcase fails
What is the expected output? What do you see instead?
Since calling free(0) is a no-op in standard C, cmockery should not behave
differently.
What version of the product are you using? On what operating system?
cmockery-0.1.2 on windows XP using cygwin
Please provide any additional information below.
Original issue reported on code.google.com by [email protected]
on 1 Apr 2010 at 9:42
What steps will reproduce the problem?
1. Compile test-cmockery with
gcc -std=c99 -I/opt/include -L/opt/lib -lcmockery test-cmockery.c -o
test-cmockery
2. Run ./test-cmockery
What is the expected output? What do you see instead?
Expected output:
sizeof(unsigned long long): 8
sizeof(unsigned): 4
sizeof(char*): 8
4365541014
70573718
70573718
4365541014
test_demo: Starting test
test_demo: Test completed successfully.
All 1 tests passed
Actual output:
sizeof(unsigned long long): 8
sizeof(unsigned): 4
sizeof(char*): 8
4438503062
143535766
143535766
4438503062
test_demo: Starting test
Segmentation fault: 11
test_demo: Test failed.
1 out of 1 tests failed!
test_demo
What version of the product are you using? On what operating system?
Git commit: 1c63f1f479463d9cb5185681cf11799e8efa9092
on Macintosh OS X Mountain Lion 10.8.5
Please provide any additional information below.
By modifying the macro cast_to_largest_integral_type (cmockery.h, line 51), it
is possible to to remove the error and see the expected output. Specifically,
changing
#define cast_to_largest_integral_type(value) \
((LargestIntegralType)((unsigned)(value)))
to
#define cast_to_largest_integral_type(value) \
((LargestIntegralType)((unsigned long long)(value)))
removes the error. What is the purpose of casting a pointer (8 bytes on my
system), to an unsigned integer (4 bytes on my system), then back to an
unsigned long long (8 bytes on my system)?
Original issue reported on code.google.com by [email protected]
on 4 Jun 2014 at 8:25
Attachments:
What steps will reproduce the problem?
1. Compile and execute assert_module_test.c on LP64 platform.
2. Observe crash in setjmp.
What is the expected output? What do you see instead?
What version of the product are you using? On what operating system?
Please provide any additional information below.
Fix by replacing the passing of the assert expression in the longjmp argument
with passing the
expression in a member of a volatile global structure.
Original issue reported on code.google.com by [email protected]
on 2 Mar 2010 at 5:48
What steps will reproduce the problem?
1. Compile on LP64 platform.
2. Observe gcc warning messages.
What is the expected output?
No warnings.
What do you see instead?
/Users/smb/src/cmockery-staging/osx/../src/cmockery.c: In function '_test_free':
/Users/smb/src/cmockery-staging/osx/../src/cmockery.c:1405: warning: cast from
pointer to
integer of different size
What version of the product are you using? On what operating system?
Please provide any additional information below.
Problem is statement:
_assert_true((int)ptr, "ptr", file, line);
Original issue reported on code.google.com by [email protected]
on 2 Mar 2010 at 1:54
Hi !
If you have a function with "long long" parameters/return value, like this
one :
int myFunction(long long id, char *name);
If I try to do a mockup with this function :
int myFunction(long long id, char *name) {
check_expected(id);
check_expected(name);
return *(int *)mock();
}
First, the computer will warn me "warning: cast to pointer from integer of
different size". The line "check_expected(id);" seems to trig the problem.
In fact the macro cast its parameter to a "void *", but a "void *" is a 32
bits wide and the "id" parameter is 64 bits wide.
I can ignore the warning and continue with it, but the checked value will
be truncated, the test will be a success, if I do someting like :
...
expect_value(myFunction, id, 0x34FFFFFFFF);
...
myFunction(0x89FFFFFFFF, "hello");
...
What is your opinion on it ?
Would it be easy to cast the "value" parameter to the biggest type
available on the current host (long long ?) ?
Or will it break something ?
Thanks for your help and for this amazing tool : mockup in c is a really
cool feature !
Original issue reported on code.google.com by [email protected]
on 7 Oct 2008 at 9:02
What steps will reproduce the problem?
1. execute "cc +DD64 -c -I../include cmockery.c"
What is the expected output? What do you see instead?
Nothing should be printed but it says:
"cmockery.c", line 1657: warning #2069-D: integer conversion resulted in
truncation
assert_false("BUG: shouldn't be here!");
What version of the product are you using? On what operating system?
1. cmockery-0.1.2
2. HP-UX 11 IA64 v3
uname -a
HP-UX hpitv3 B.11.31 U ia64 0383467329 unlimited-user license
cc --version
cc: HP C/aC++ B3910B A.06.22 [Nov 14 2008]
Please provide any additional information below.
The statement causing the warning should be fixed anyway. The patch below
does it as the HP-UX workaround:
--- cmockery.c Sat Aug 30 02:55:53 2008
+++ cmockery.c Tue Jul 21 10:46:56 2009
@@ -1650,7 +1650,9 @@
}
break;
default:
+#ifdef _HPUX
assert_false("BUG: shouldn't be here!");
+#endif
break;
}
Using _HPUX macro allows to compile on HP-UX without this warning.
Original issue reported on code.google.com by [email protected]
on 21 Jul 2009 at 10:31
What steps will reproduce the problem?
1. Compile cmockery using gcc version 4.2.1.
2. Observe warning messages.
What is the expected output?
No warnings
What do you see instead?
/Users/smb/src/cmockery-staging/osx/../src/cmockery.c: In function
'vprint_message':
/Users/smb/src/cmockery-staging/osx/../src/cmockery.c:1550: warning: format not
a string
literal and no format arguments
/Users/smb/src/cmockery-staging/osx/../src/cmockery.c: In function
'vprint_error':
/Users/smb/src/cmockery-staging/osx/../src/cmockery.c:1561: warning: format not
a string
literal and no format arguments
What version of the product are you using? On what operating system?
cmockery tip on Mac OS 10.6.2 using Xcode 3.2.1, also on CentOS 5.4 wtih gcc
(GCC) 4.1.2
20080704 (Red Hat 4.1.2-46)
Please provide any additional information below.
Trivially fixed by adding printf format string to the two printf and fprintf
calls:
printf("%s", buffer);
fprintf(stderr, "%s", buffer);
Original issue reported on code.google.com by [email protected]
on 1 Mar 2010 at 7:03
What steps will reproduce the problem?
When testing a function, say "foo", that uses "printf", if I a
mock "printf" using mock() and check_expected() and write a test
for "foo", when executing the test, cmockery crashes (segfault). Here is a
small snippet of code illustrating what I mean:
// foo.c
int foo() {
return printf("toto");
}
// foo_test.c
int printf(const char *format, ...) {
check_expected(format);
return (int)mock();
}
void my_test(void **state) {
expect_string(printf, format, "toto");
will_return(printf, 30);
assert_int_equal(foo(), 30);
}
When executing the test, the program segfaults. Here is the gdb backtrace:
Program received signal SIGSEGV, Segmentation fault.
0x0804928b in list_find ()
(gdb) bt
#0 0x0804928b in list_find ()
#1 0x080495fb in get_symbol_value ()
#2 0x0804a6ff in _check_expected ()
#3 0x08048ce3 in printf ()
#4 0x0804aff0 in vprint_message ()
#5 0x0804b057 in print_message ()
#6 0x0804b106 in _run_test ()
#7 0x0804b3d1 in _run_tests ()
#8 0x08048db3 in main ()
What is the expected output? What do you see instead?
the test should pass (?)
What version of the product are you using? On what operating system?
cmockery 0.1.2 on linux (debian 4.1.1-21) with gcc 4.1.2
I attached the code provoking the buf...
Otherwise cmockery rules! ;-)
Thanks for looking into this!
Original issue reported on code.google.com by [email protected]
on 15 Oct 2009 at 9:22
Attachments:
What steps will reproduce the problem?
1. Compile on LP64 platform such as Mac OS X or Linux on x86_64
2. Observed compiler warning messages.
What is the expected output?
No warnings.
What do you see instead?
/Users/smb/src/cmockery-staging/osx/../src/cmockery.c: In function
'free_symbol_map_value':
/Users/smb/src/cmockery-staging/osx/../src/cmockery.c:474: warning: cast from
pointer to
integer of different size
/Users/smb/src/cmockery-staging/osx/../src/cmockery.c:478: warning: cast to
pointer from
integer of different size
What version of the product are you using? On what operating system?
Please provide any additional information below.
Original issue reported on code.google.com by [email protected]
on 2 Mar 2010 at 1:48
What steps will reproduce the problem?
1. compile any unit tests bundle and link it against cmockery
What is the expected output? What do you see instead?
Linking fails with the following error:
ld: Unsatisfied symbol "strsignal" in file cmockery.o
What version of the product are you using? On what operating system?
1. cmockery-0.1.2
2. HP-UX 11 IA64 v3
uname -a
HP-UX hpitv3 B.11.31 U ia64 0383467329 unlimited-user license
Please provide any additional information below.
The 'strsignal()' function is not available on HP-UX. The following is not a
proper
solution but the workaround. Using _HPUX macro allows to link successfully on
HP-UX.
--- cmockery.c Sat Aug 30 02:55:54 2008
+++ cmockery.c Tue Jul 21 10:44:53 2009
@@ -1402,7 +1402,11 @@
#ifndef _WIN32
static void exception_handler(int sig) {
+#ifdef _HPUX
+ print_error("%d\n", sig);
+#else
print_error("%s\n", strsignal(sig));
+#endif
exit_test(1);
}
Original issue reported on code.google.com by [email protected]
on 21 Jul 2009 at 10:20
What steps will reproduce the problem on HP-UX?
1. execute "cc -c -I../include cmockery.c"
What is the expected output? What do you see instead?
Nothing should be printed. But it says:
"cmockery.c", line 1679: warning #2068-D: integer conversion resulted in a
change of sign
total_failed = -1;
^
What version of the product are you using? On what operating system?
1. cmockery 0.1.2
2. HP-UX IA64
uname -a
HP-UX hpitv3 B.11.31 U ia64 0383467329 unlimited-user license
Please provide any additional information below.
Following patch removes this warning:
--- cmockery.c Sat Aug 30 02:55:54 2008
+++ cmockery.c Tue Jul 21 11:00:53 2009
@@ -1670,7 +1670,7 @@
if (number_of_test_states) {
print_error("Mismatched number of setup %d and teardown %d
"
"functions\n", setups, teardowns);
- total_failed = -1;
+ total_failed = (size_t)-1;
}
free(test_states);
Original issue reported on code.google.com by [email protected]
on 21 Jul 2009 at 10:13
My application is written in ProC which is having many .pc files
I have only a Makefile to compile all this .pc files...We dont have
.configure or any other libtool files.
So i added one more line in my Makefile to create a test exe for
run_tests.c by including libcmockery.la
but while compiling its giving link error as following
cc -o Test -L/usr/oracle/product/9.2.0_client/lib/ -DUNIT_TESTING=1 -o
./test run_tests.c -L../../mdi_lib/ -lMDI_dyn_proc
../../mdi_lib/MDI_lib.a
/confman/rcs_wa/ccbs/LIBRARIES/lib/OSF1_V5.1/lib//libcommon.a -lclntsh `cat
/usr/oracle/product/9.2.0_client/lib/ldflags` `cat
/usr/oracle/product/9.2.0_client/lib/sysliblist` -lm -lpthread
ld:
Unresolved:
_run_tests
make: *** [Test] Error 1
when i tried to run the test its giving me below problem
./test
resolve_symbols: loader error: dlopen: ./test: symbol "_run_tests" unresolved
what should i change in my Makefile?
Original issue reported on code.google.com by [email protected]
on 4 Feb 2010 at 7:12
Line30:
for (i = 0; i < sizeof(status_code_string) / sizeof(status_code_string[0]);
change it as follow:
for (i = 0; i < sizeof(status_code_strings) / sizeof(status_code_strings[0]);
Original issue reported on code.google.com by khb.hnu
on 12 Apr 2009 at 2:00
What steps will reproduce the problem?
1. compile the standard cmockery example 'assert_macro_test.exe' on Windows
2. execute "assert_macro_test.exe 1>output 2>&1"
What is the expected output? What do you see instead?
The file "output" should contain:
get_status_code_string_test: Starting test
"Connection dropped" != "Connection timed out"
ERROR: ..\src\example\assert_macro_test.c:29 Failure!
get_status_code_string_test: Test failed.
string_to_status_code_test: Starting test
0x2 != 0x1
ERROR: ..\src\example\assert_macro_test.c:35 Failure!
string_to_status_code_test: Test failed.
2 out of 2 tests failed!
get_status_code_string_test
string_to_status_code_test
but it contains:
get_status_code_string_test: Starting test
get_status_code_string_test: Test failed.
string_to_status_code_test: Starting test
string_to_status_code_test: Test failed.
"Connection dropped" != "Connection timed out"
ERROR: ..\src\example\assert_macro_test.c:29 Failure!
0x2 != 0x1
ERROR: ..\src\example\assert_macro_test.c:35 Failure!
2 out of 2 tests failed!
get_status_code_string_test
string_to_status_code_test
What version of the product are you using? On what operating system?
1. cmockery 0.1.2
2. Windows XP SP3
3. Visual Studio 2008
Please provide any additional information below.
fflush() function should be called after each line printed to the stdout or
stderr.
The patch below fixes this problem:
--- cmockery.c Sat Aug 30 02:55:54 2008
+++ cmockery.c Tue Jul 21 10:24:14 2009
@@ -1449,6 +1449,7 @@
char buffer[1024];
vsnprintf(buffer, sizeof(buffer), format, args);
printf(buffer);
+ fflush(stdout);
#ifdef _WIN32
OutputDebugString(buffer);
#endif // _WIN32
@@ -1459,6 +1460,7 @@
char buffer[1024];
vsnprintf(buffer, sizeof(buffer), format, args);
fprintf(stderr, buffer);
+ fflush(stderr);
#ifdef _WIN32
OutputDebugString(buffer);
#endif // _WIN32
Original issue reported on code.google.com by [email protected]
on 21 Jul 2009 at 10:39
What steps will reproduce the problem?
1. Use the macro 'will_return_count' with a count value of -1
2.
3.
What is the expected output? What do you see instead?
The documentation indicates that the specified value will always be
repeated when the count is -1. When used, the first assertion in
_will_return fires.
>>>>
assert_true(count > 0);
What version of the product are you using? On what operating system?
cmockery-0.1.2
Windows Vista/Linux
Please provide any additional information below.
Original issue reported on code.google.com by [email protected]
on 26 Oct 2008 at 7:03
COPYING[1] (incorrectly) indicates that cmockery is distributed under a BSD
license.
[1] http://code.google.com/p/cmockery/source/browse/trunk/COPYING
Original issue reported on code.google.com by [email protected]
on 16 Nov 2009 at 10:36
Hi!
I think adding the standard required headers within #if/#endif would reduce
the code needed to bootstrap a new test.
#ifndef CMOCKERY_NO_STANDARD_HEADERS
#include <stdarg.h>
#include <stddef.h>
#include <setjmp.h>
#endif
Original issue reported on code.google.com by tommie%[email protected]
on 18 Aug 2009 at 7:24
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.