aceunit-commit Mailing List for AceUnit (Page 23)
Status: Beta
Brought to you by:
christianhujer
You can subscribe to this list here.
2007 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
(139) |
Nov
(77) |
Dec
(32) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2008 |
Jan
(55) |
Feb
(11) |
Mar
(3) |
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
(9) |
Oct
(75) |
Nov
(57) |
Dec
(21) |
2009 |
Jan
(14) |
Feb
(1) |
Mar
|
Apr
|
May
|
Jun
(1) |
Jul
|
Aug
(24) |
Sep
(11) |
Oct
(1) |
Nov
|
Dec
|
2011 |
Jan
|
Feb
(21) |
Mar
(10) |
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
2013 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
(3) |
From: <chr...@us...> - 2007-10-07 14:46:38
|
Revision: 32 http://aceunit.svn.sourceforge.net/aceunit/?rev=32&view=rev Author: christianhujer Date: 2007-10-07 07:46:41 -0700 (Sun, 07 Oct 2007) Log Message: ----------- Implemented correct version of compareInt(). Modified Paths: -------------- trunk/src/doc/examples/sort/sortTest.c Modified: trunk/src/doc/examples/sort/sortTest.c =================================================================== --- trunk/src/doc/examples/sort/sortTest.c 2007-10-07 14:43:58 UTC (rev 31) +++ trunk/src/doc/examples/sort/sortTest.c 2007-10-07 14:46:41 UTC (rev 32) @@ -13,7 +13,12 @@ * @see comparator */ int compareInt(const void *o1, const void *o2) { - return 0; + const int *p1 = o1; + const int *p2 = o2; + return + *p1 < *p2 ? -1 : + *p1 > *p2 ? +1 : + 0; } /** Verifies that a vector is sorted. This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <chr...@us...> - 2007-10-07 14:43:54
|
Revision: 31 http://aceunit.svn.sourceforge.net/aceunit/?rev=31&view=rev Author: christianhujer Date: 2007-10-07 07:43:58 -0700 (Sun, 07 Oct 2007) Log Message: ----------- Added runTests to ignored files. Property Changed: ---------------- trunk/src/doc/examples/sort/ Property changes on: trunk/src/doc/examples/sort ___________________________________________________________________ Name: svn:ignore - AceUnit.jar FullPlainLogger.c AceUnit.c sortTest.h AceUnit.h + AceUnit.jar FullPlainLogger.c AceUnit.c sortTest.h AceUnit.h runTests This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <chr...@us...> - 2007-10-07 14:43:29
|
Revision: 30 http://aceunit.svn.sourceforge.net/aceunit/?rev=30&view=rev Author: christianhujer Date: 2007-10-07 07:43:33 -0700 (Sun, 07 Oct 2007) Log Message: ----------- Added main for testing purposes. Modified Paths: -------------- trunk/src/doc/examples/sort/sortTest.c Modified: trunk/src/doc/examples/sort/sortTest.c =================================================================== --- trunk/src/doc/examples/sort/sortTest.c 2007-10-07 14:42:36 UTC (rev 29) +++ trunk/src/doc/examples/sort/sortTest.c 2007-10-07 14:43:33 UTC (rev 30) @@ -64,3 +64,10 @@ } #include "sortTest.h" + +// Run the tests. +// Note: This is only here temporarily. +// In future versions, this part will be auto-generated. +int main(int argc, char *argv[]) { + runFixture(&sortTestFixture); +} This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <chr...@us...> - 2007-10-07 14:42:33
|
Revision: 29 http://aceunit.svn.sourceforge.net/aceunit/?rev=29&view=rev Author: christianhujer Date: 2007-10-07 07:42:36 -0700 (Sun, 07 Oct 2007) Log Message: ----------- Renamed testExample to runTests. Added runTests to clean. Modified Paths: -------------- trunk/src/doc/examples/sort/Makefile Modified: trunk/src/doc/examples/sort/Makefile =================================================================== --- trunk/src/doc/examples/sort/Makefile 2007-10-07 14:40:32 UTC (rev 28) +++ trunk/src/doc/examples/sort/Makefile 2007-10-07 14:42:36 UTC (rev 29) @@ -1,8 +1,9 @@ ACE_UNIT_PATH=../../../ + all: prepare compile clean: - rm -f AceUnit.c AceUnit.h FullPlainLogger.c AceUnit.jar sortTest.h + rm -f AceUnit.c AceUnit.h FullPlainLogger.c AceUnit.jar sortTest.h runTests prepare: AceUnit.c AceUnit.h FullPlainLogger.c @@ -21,10 +22,10 @@ $(ACE_UNIT_PATH)/java/AceUnit.jar: (cd $(ACE_UNIT_PATH)/java ; ant) -compile: testExample +compile: runTests sortTest.h: AceUnit.jar sortTest.c java -cp AceUnit.jar net.sf.aceunit.GenTest sortTest >sortTest.h -testExample: *.c *.h sortTest.h - gcc -o testExample *.c +runTests: *.c *.h sortTest.h + gcc -o runTests *.c This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <chr...@us...> - 2007-10-07 14:40:29
|
Revision: 28 http://aceunit.svn.sourceforge.net/aceunit/?rev=28&view=rev Author: christianhujer Date: 2007-10-07 07:40:32 -0700 (Sun, 07 Oct 2007) Log Message: ----------- Fixed bug in TM macro: string was not properly generated. Modified Paths: -------------- trunk/src/native/AceUnit.h Modified: trunk/src/native/AceUnit.h =================================================================== --- trunk/src/native/AceUnit.h 2007-10-07 14:32:57 UTC (rev 27) +++ trunk/src/native/AceUnit.h 2007-10-07 14:40:32 UTC (rev 28) @@ -201,5 +201,5 @@ #ifdef ACEUNIT_EMBEDDED // TODO #else -#define TM(X) { "X", &X } +#define TM(X) { #X, &X } #endif This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <chr...@us...> - 2007-10-07 14:32:53
|
Revision: 27 http://aceunit.svn.sourceforge.net/aceunit/?rev=27&view=rev Author: christianhujer Date: 2007-10-07 07:32:57 -0700 (Sun, 07 Oct 2007) Log Message: ----------- Set ignore property so auto-generated files are ignored here. Property Changed: ---------------- trunk/src/doc/examples/sort/ Property changes on: trunk/src/doc/examples/sort ___________________________________________________________________ Name: svn:ignore + AceUnit.jar FullPlainLogger.c AceUnit.c sortTest.h AceUnit.h This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <chr...@us...> - 2007-10-07 14:32:26
|
Revision: 26 http://aceunit.svn.sourceforge.net/aceunit/?rev=26&view=rev Author: christianhujer Date: 2007-10-07 07:32:30 -0700 (Sun, 07 Oct 2007) Log Message: ----------- Fixed bug in Makefile. Added some missing files to clean. Modified Paths: -------------- trunk/src/doc/examples/sort/Makefile Modified: trunk/src/doc/examples/sort/Makefile =================================================================== --- trunk/src/doc/examples/sort/Makefile 2007-10-07 14:31:29 UTC (rev 25) +++ trunk/src/doc/examples/sort/Makefile 2007-10-07 14:32:30 UTC (rev 26) @@ -2,7 +2,7 @@ all: prepare compile clean: - rm -f AceUnit.c AceUnit.h FullPlainLogger.c + rm -f AceUnit.c AceUnit.h FullPlainLogger.c AceUnit.jar sortTest.h prepare: AceUnit.c AceUnit.h FullPlainLogger.c @@ -18,7 +18,7 @@ AceUnit.jar: $(ACE_UNIT_PATH)/java/AceUnit.jar cp $< $@ -$(ACE_UNIT_PATH)/java/AceUnit.jar +$(ACE_UNIT_PATH)/java/AceUnit.jar: (cd $(ACE_UNIT_PATH)/java ; ant) compile: testExample This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <chr...@us...> - 2007-10-07 14:31:26
|
Revision: 25 http://aceunit.svn.sourceforge.net/aceunit/?rev=25&view=rev Author: christianhujer Date: 2007-10-07 07:31:29 -0700 (Sun, 07 Oct 2007) Log Message: ----------- Added missing tasks for target clean. Modified Paths: -------------- trunk/src/java/build.xml Modified: trunk/src/java/build.xml =================================================================== --- trunk/src/java/build.xml 2007-10-07 14:29:19 UTC (rev 24) +++ trunk/src/java/build.xml 2007-10-07 14:31:29 UTC (rev 25) @@ -5,6 +5,8 @@ name = "clean" description = "Removes auto-generated files and directories." > + <delete dir="classes" /> + <delete file="AceUnit.jar" /> </target> <target This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <chr...@us...> - 2007-10-07 14:29:15
|
Revision: 24 http://aceunit.svn.sourceforge.net/aceunit/?rev=24&view=rev Author: christianhujer Date: 2007-10-07 07:29:19 -0700 (Sun, 07 Oct 2007) Log Message: ----------- Removed auto-generated file from repo. Removed Paths: ------------- trunk/src/doc/examples/sort/sortTest.h Deleted: trunk/src/doc/examples/sort/sortTest.h =================================================================== --- trunk/src/doc/examples/sort/sortTest.h 2007-10-07 14:27:49 UTC (rev 23) +++ trunk/src/doc/examples/sort/sortTest.h 2007-10-07 14:29:19 UTC (rev 24) @@ -1,26 +0,0 @@ -TestCase_t testCase[] = { - TM(testCompareInt), - TM(testSort), - {NULL, NULL} -}; -testMethod_t before[] = { - NULL -}; -testMethod_t after[] = { - NULL -}; -testMethod_t beforeClass[] = { - NULL -}; -testMethod_t afterClass[] = { - NULL -}; - -TestFixture_t sortTestFixture = { - testCase, - before, - after, - beforeClass, - afterClass -}; - This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <chr...@us...> - 2007-10-07 14:27:45
|
Revision: 23 http://aceunit.svn.sourceforge.net/aceunit/?rev=23&view=rev Author: christianhujer Date: 2007-10-07 07:27:49 -0700 (Sun, 07 Oct 2007) Log Message: ----------- Added build.xml to auto-generate java program. Added Paths: ----------- trunk/src/java/build.xml Property Changed: ---------------- trunk/src/java/ Property changes on: trunk/src/java ___________________________________________________________________ Name: svn:ignore + AceUnit.jar classes Added: trunk/src/java/build.xml =================================================================== --- trunk/src/java/build.xml (rev 0) +++ trunk/src/java/build.xml 2007-10-07 14:27:49 UTC (rev 23) @@ -0,0 +1,40 @@ +<?xml version="1.0"?> +<project name="AceUnit" default="jar"> + + <target + name = "clean" + description = "Removes auto-generated files and directories." + > + </target> + + <target + name = "compile" + description = "Compiles AceUnit java source code." + > + <mkdir dir="classes/production" /> + <javac + srcdir = "src/prj" + destdir = "classes/production" + encoding = "utf-8" + debug = "yes" + target = "1.5" + source = "1.5" + /> + </target> + + <target + name = "jar" + description = "Creates AceUnit.jar executable jar archive." + depends = "clean, compile" + > + <jar + destfile = "AceUnit.jar" + basedir = "classes/production" + > + <manifest> + <attribute name="Main-Class" value="net.sf.aceunit.GenTest" /> + </manifest> + </jar> + </target> + +</project> Property changes on: trunk/src/java/build.xml ___________________________________________________________________ Name: svn:mime-type + text/xml Name: svn:eol-style + LF This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <chr...@us...> - 2007-10-07 14:17:44
|
Revision: 22 http://aceunit.svn.sourceforge.net/aceunit/?rev=22&view=rev Author: christianhujer Date: 2007-10-07 07:17:47 -0700 (Sun, 07 Oct 2007) Log Message: ----------- Moved package to proper location. Added Paths: ----------- trunk/src/java/src/ trunk/src/java/src/prj/ trunk/src/java/src/prj/net/ Removed Paths: ------------- trunk/src/java/net/ Copied: trunk/src/java/src/prj/net (from rev 21, trunk/src/java/net) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <chr...@us...> - 2007-10-07 14:12:25
|
Revision: 21 http://aceunit.svn.sourceforge.net/aceunit/?rev=21&view=rev Author: christianhujer Date: 2007-10-07 07:12:23 -0700 (Sun, 07 Oct 2007) Log Message: ----------- Fixed some bugs in generated source code. Modified Paths: -------------- trunk/src/java/net/sf/aceunit/GenTest.java Modified: trunk/src/java/net/sf/aceunit/GenTest.java =================================================================== --- trunk/src/java/net/sf/aceunit/GenTest.java 2007-10-07 14:10:33 UTC (rev 20) +++ trunk/src/java/net/sf/aceunit/GenTest.java 2007-10-07 14:12:23 UTC (rev 21) @@ -60,14 +60,13 @@ for (final String testMethod : testMethods) { out.append(" TM(").append(testMethod).append("),\n"); } - out.append(" {NULL, NULL}\n"); - out.append("};\n"); + out.append(" {NULL, NULL}\n};\n"); appendMethods(out, "before", beforeMethods); appendMethods(out, "after", afterMethods); appendMethods(out, "beforeClass", beforeClassMethods); appendMethods(out, "afterClass", afterClassMethods); out.append("\n"); - out.append("TestFixture_t ").append(basename).append("Fixture").append(" = {\n testCase,\n before,\n after,\n beforeClass,\n afterClass\n);\n\n"); + out.append("TestFixture_t ").append(basename).append("Fixture = {\n testCase,\n before,\n after,\n beforeClass,\n afterClass\n};\n\n"); } /** Appends the method list to the specified output. @@ -81,8 +80,7 @@ for (final String method : methods) { out.append(" &").append(method).append(",\n"); } - out.append(" NULL\n"); - out.append(");\n"); + out.append(" NULL\n};\n"); } /** Reads a source file. This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <chr...@us...> - 2007-10-07 14:10:32
|
Revision: 20 http://aceunit.svn.sourceforge.net/aceunit/?rev=20&view=rev Author: christianhujer Date: 2007-10-07 07:10:33 -0700 (Sun, 07 Oct 2007) Log Message: ----------- Fixed bug: macro TM didn't match TestCase_t. Modified Paths: -------------- trunk/src/native/AceUnit.h Modified: trunk/src/native/AceUnit.h =================================================================== --- trunk/src/native/AceUnit.h 2007-10-07 14:09:30 UTC (rev 19) +++ trunk/src/native/AceUnit.h 2007-10-07 14:10:33 UTC (rev 20) @@ -198,4 +198,8 @@ /** Define a test case (pair of method's function pointer and name). * @param X test case to define */ -#define TM(X) { &X, "X" } +#ifdef ACEUNIT_EMBEDDED +// TODO +#else +#define TM(X) { "X", &X } +#endif This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <chr...@us...> - 2007-10-07 14:09:26
|
Revision: 19 http://aceunit.svn.sourceforge.net/aceunit/?rev=19&view=rev Author: christianhujer Date: 2007-10-07 07:09:30 -0700 (Sun, 07 Oct 2007) Log Message: ----------- Added example for testing sort. Unfinnished. Added Paths: ----------- trunk/src/doc/examples/ trunk/src/doc/examples/sort/ trunk/src/doc/examples/sort/Makefile trunk/src/doc/examples/sort/sort.h trunk/src/doc/examples/sort/sortTest.c trunk/src/doc/examples/sort/sortTest.h Added: trunk/src/doc/examples/sort/Makefile =================================================================== --- trunk/src/doc/examples/sort/Makefile (rev 0) +++ trunk/src/doc/examples/sort/Makefile 2007-10-07 14:09:30 UTC (rev 19) @@ -0,0 +1,30 @@ +ACE_UNIT_PATH=../../../ +all: prepare compile + +clean: + rm -f AceUnit.c AceUnit.h FullPlainLogger.c + +prepare: AceUnit.c AceUnit.h FullPlainLogger.c + +AceUnit.c: $(ACE_UNIT_PATH)/native/AceUnit.c + cp $< $@ + +AceUnit.h: $(ACE_UNIT_PATH)/native/AceUnit.h + cp $< $@ + +FullPlainLogger.c: $(ACE_UNIT_PATH)/native/FullPlainLogger.c + cp $< $@ + +AceUnit.jar: $(ACE_UNIT_PATH)/java/AceUnit.jar + cp $< $@ + +$(ACE_UNIT_PATH)/java/AceUnit.jar + (cd $(ACE_UNIT_PATH)/java ; ant) + +compile: testExample + +sortTest.h: AceUnit.jar sortTest.c + java -cp AceUnit.jar net.sf.aceunit.GenTest sortTest >sortTest.h + +testExample: *.c *.h sortTest.h + gcc -o testExample *.c Property changes on: trunk/src/doc/examples/sort/Makefile ___________________________________________________________________ Name: svn:mime-type + text/plain Name: svn:eol-style + native Added: trunk/src/doc/examples/sort/sort.h =================================================================== --- trunk/src/doc/examples/sort/sort.h (rev 0) +++ trunk/src/doc/examples/sort/sort.h 2007-10-07 14:09:30 UTC (rev 19) @@ -0,0 +1,17 @@ +/** Interface to sort. + * From AceUnit example for unit testing a sort function. + * @author <a href="mailto:ch...@ri...">Christian Hujer</a> + * @file sort.h + */ + +#include <stdint.h> + +/** A Comparator compares two values and returns a comparison result. + * @param o1 Pointer to first object to compare. + * @param o2 Pointer to second object to compare. + * @return Comparison result + * @retval 0 if o1 and o2 are equal. + * @retval <0 if o1 should be sorted before o2. + * @retval >0 if o1 should be sorted after o2. + */ +typedef int(*comparator)(const void *o1, const void *o2); Property changes on: trunk/src/doc/examples/sort/sort.h ___________________________________________________________________ Name: svn:mime-type + text/plain Name: svn:eol-style + native Added: trunk/src/doc/examples/sort/sortTest.c =================================================================== --- trunk/src/doc/examples/sort/sortTest.c (rev 0) +++ trunk/src/doc/examples/sort/sortTest.c 2007-10-07 14:09:30 UTC (rev 19) @@ -0,0 +1,66 @@ +/** Unit Test for sort. + * AceUnit example for unit testing a sort function. + * @author <a href="mailto:ch...@ri...">Christian Hujer</a> + * @file sortTest.c + */ + +#include <stdbool.h> +#include <stdlib.h> +#include "AceUnit.h" +#include "sort.h" + +/** Comparator for int values. + * @see comparator + */ +int compareInt(const void *o1, const void *o2) { + return 0; +} + +/** Verifies that a vector is sorted. + * @param vector Vector to verify. + * @param nmemb Length of the vector to verify. + * @param size Size of an element within the vector. + * @param comp Comparator to use for the verification. + * @return Whether the vector is sorted. + * @retval true if the vector is sorted. + * @retval false otherwise. + */ +bool isSorted(const void *vector, const size_t nmemb, const size_t size, const comparator comp) { + int i; + const char *ptr = vector; + for (i = 0; i < nmemb - 1; i++) { + if (comp(&ptr[i * size], &ptr[(i + 1) * size]) > 0) { + return false; + } + } + return true; +} + +/** Tests that {@link compareInt()} works. */ +A_Test void testCompareInt() { + int n1; + int n2; + + n1 = 0; + n2 = 0; + assertEquals("Comparing two equal numbers must return 0.", 0, compareInt(&n1, &n2)); + + n1 = 1; + n2 = 2; + assertTrue("Comparing 1 with 2 must return a value <0.", compareInt(&n1, &n2) < 0); + + n1 = 2; + n2 = 1; + assertTrue("Comparing 2 with 1 must return a value >0.", compareInt(&n1, &n2) > 0); +} + +/** Tests that {@link sort()} works. */ +A_Test void testSort() { + int testling[] = { 5, 4, 3, 2, 1 }; + assertFalse("This vector is not yet sorted.", isSorted(testling, 5, sizeof(int), &compareInt)); + sort(testling, &compareInt); + qsort(testling, 5, sizeof(int), &compareInt); + assertTrue("This vector now is sorted.", isSorted(testling, 5, sizeof(int), &compareInt)); +} + +#include "sortTest.h" Property changes on: trunk/src/doc/examples/sort/sortTest.c ___________________________________________________________________ Name: svn:mime-type + text/plain Name: svn:eol-style + native Added: trunk/src/doc/examples/sort/sortTest.h =================================================================== --- trunk/src/doc/examples/sort/sortTest.h (rev 0) +++ trunk/src/doc/examples/sort/sortTest.h 2007-10-07 14:09:30 UTC (rev 19) @@ -0,0 +1,26 @@ +TestCase_t testCase[] = { + TM(testCompareInt), + TM(testSort), + {NULL, NULL} +}; +testMethod_t before[] = { + NULL +}; +testMethod_t after[] = { + NULL +}; +testMethod_t beforeClass[] = { + NULL +}; +testMethod_t afterClass[] = { + NULL +}; + +TestFixture_t sortTestFixture = { + testCase, + before, + after, + beforeClass, + afterClass +}; + Property changes on: trunk/src/doc/examples/sort/sortTest.h ___________________________________________________________________ Name: svn:mime-type + text/plain Name: svn:eol-style + native This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <chr...@us...> - 2007-10-07 14:09:18
|
Revision: 18 http://aceunit.svn.sourceforge.net/aceunit/?rev=18&view=rev Author: christianhujer Date: 2007-10-07 07:09:17 -0700 (Sun, 07 Oct 2007) Log Message: ----------- Fixed another html error (unable to find for validator). Modified Paths: -------------- trunk/src/doc/manual.xhtml Modified: trunk/src/doc/manual.xhtml =================================================================== --- trunk/src/doc/manual.xhtml 2007-10-07 12:38:51 UTC (rev 17) +++ trunk/src/doc/manual.xhtml 2007-10-07 14:09:17 UTC (rev 18) @@ -32,12 +32,12 @@ * @retval <0 if o1 should be sorted before o2. * @retval >0 if o1 should be sorted after o2. */ -typedef sint8_least_t(*comparator)(const void *o1, const void *o2);</pre> +typedef sint8_least_t(*comparator)(const void *o1, const void *o2);]]></pre> <p> For testing purposes, we want to sort ints. So the first thing that we do is we test whether our comparator implementation works. </p> - <pre>/** Comparator for int values. + <pre><![CDATA[/** Comparator for int values. * @see comparator */ sint8_least_t compareInt(const void *o1, const void *o2) { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |