aceunit-commit Mailing List for AceUnit (Page 19)
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-28 15:01:21
|
Revision: 132 http://aceunit.svn.sourceforge.net/aceunit/?rev=132&view=rev Author: christianhujer Date: 2007-10-28 08:01:22 -0700 (Sun, 28 Oct 2007) Log Message: ----------- Added include shields. Modified Paths: -------------- trunk/src/native/AceUnit.h trunk/src/native/AceUnitAnnotations.h Modified: trunk/src/native/AceUnit.h =================================================================== --- trunk/src/native/AceUnit.h 2007-10-28 14:33:35 UTC (rev 131) +++ trunk/src/native/AceUnit.h 2007-10-28 15:01:22 UTC (rev 132) @@ -25,6 +25,9 @@ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ +#ifndef _ACEUNIT_H +#define _ACEUNIT_H 1 + /** AceUnit header file. * When using AceUnit, this is the header file that you need to include in your test fixtures. * The following options are supported: @@ -235,3 +238,5 @@ // TODO: method that the runner stopped running. } TestLogger_t; + +#endif /* _ACEUNIT_H */ Modified: trunk/src/native/AceUnitAnnotations.h =================================================================== --- trunk/src/native/AceUnitAnnotations.h 2007-10-28 14:33:35 UTC (rev 131) +++ trunk/src/native/AceUnitAnnotations.h 2007-10-28 15:01:22 UTC (rev 132) @@ -25,6 +25,9 @@ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ +#ifndef _ACEUNITANNOTATIONS_H +#define _ACEUNITANNOTATIONS_H 1 + /** AceUnit Annotations header file. * @author <a href="mailto:ch...@ri...">Christian Hujer</a> * @file AceUnitAnnotations.h @@ -65,3 +68,5 @@ * @param reason Description of the reason why this test case is currently ignored. */ #define A_IgnoreR(reason) ACEUNIT_ANNOTATION + +#endif /* _ACEUNITANNOTATIONS_H */ This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <chr...@us...> - 2007-10-28 14:33:34
|
Revision: 131 http://aceunit.svn.sourceforge.net/aceunit/?rev=131&view=rev Author: christianhujer Date: 2007-10-28 07:33:35 -0700 (Sun, 28 Oct 2007) Log Message: ----------- Added output of FIXTURE_ID. Modified Paths: -------------- trunk/src/java/src/prj/net/sf/aceunit/MethodLists.java Modified: trunk/src/java/src/prj/net/sf/aceunit/MethodLists.java =================================================================== --- trunk/src/java/src/prj/net/sf/aceunit/MethodLists.java 2007-10-28 14:30:54 UTC (rev 130) +++ trunk/src/java/src/prj/net/sf/aceunit/MethodLists.java 2007-10-28 14:33:35 UTC (rev 131) @@ -69,6 +69,11 @@ out.format(" */%n"); out.format("%n"); + out.format("#ifndef A_FIXTURE_ID%n"); + out.format("#define A_FIXTURE_ID 1%n"); // TODO increment + out.format("#endif%n"); + out.format("%n"); + out.format("%s%n", getTestMethodIds()); out.format("%s%n", getMethods("testCase", "test cases", testMethods)); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <chr...@us...> - 2007-10-28 14:30:51
|
Revision: 130 http://aceunit.svn.sourceforge.net/aceunit/?rev=130&view=rev Author: christianhujer Date: 2007-10-28 07:30:54 -0700 (Sun, 28 Oct 2007) Log Message: ----------- Changed AssertionId to be a struct. Assertionid now works in embedded mode, too. Modified Paths: -------------- trunk/src/native/AceUnit.c trunk/src/native/AceUnit.h trunk/src/native/FullPlainLogger.c Modified: trunk/src/native/AceUnit.c =================================================================== --- trunk/src/native/AceUnit.c 2007-10-28 13:39:15 UTC (rev 129) +++ trunk/src/native/AceUnit.c 2007-10-28 14:30:54 UTC (rev 130) @@ -55,13 +55,11 @@ /** Records an error. * @param fixtureId Id of the fixture that contained the test case with the failed assertion. - * @param lineNumber Line number of the assertion that failed. * @param assertionId Id of the assertion that failed. */ -void recordError(const FixtureId_t fixtureId, const linenumber_t lineNumber, const AssertionId_t assertionId) { +void recordError(const FixtureId_t fixtureId, const AssertionId_t assertionId) { recentError = &recentErrorData; recentError->fixtureId = fixtureId; - recentError->lineNumber = lineNumber; recentError->assertionId = assertionId; recentError->testId = currentTestId; } Modified: trunk/src/native/AceUnit.h =================================================================== --- trunk/src/native/AceUnit.h 2007-10-28 13:39:15 UTC (rev 129) +++ trunk/src/native/AceUnit.h 2007-10-28 14:30:54 UTC (rev 130) @@ -93,34 +93,35 @@ typedef const char* TestCaseId_t; #endif -/** MessageId_t specifies an assertion failure within a test case. - * On embedded systems, this is a 16 bit quantity that uniquely identifies the assertion within its test case. - * On normal systems, this is the message text of the assertion. - */ +/** The type to use for line numbers. */ #ifdef ACEUNIT_EMBEDDED -typedef uint16_t AssertionId_t; +typedef uint16_t linenumber_t; #else -typedef const char* AssertionId_t; +typedef int linenumber_t; #endif +/** AssertionId_t specifies an assertion failure within a test case. + * On embedded systems, this is the line number. + * On normal systems, this is the line number and the message text of the assertion. + */ +typedef struct { + linenumber_t lineNumber; +#ifndef ACEUNIT_EMBEDDED + const char *message; +#endif +} AssertionId_t; + /** Creates a new assertion error. * @param message Message to create. */ #ifdef ACEUNIT_EMBEDDED // TODO: Define A_FIXTURE_ID // TODO: Define A_ASSERTION_ID -#define newAssertionError(message) recordError(A_FIXTURE_ID, __LINE__, A_ASSERTION_ID); return +#define newAssertionError(message) recordError(A_FIXTURE_ID, (AssertionId_t) {__LINE__}); return #else -#define newAssertionError(message) recordError(__FILE__, __LINE__, message); return +#define newAssertionError(message) recordError(__FILE__, (AssertionId_t) {__LINE__, message}); return #endif -/** The type to use for line numbers. */ -#ifdef ACEUNIT_EMBEDDED -typedef uint16_t linenumber_t; -#else -typedef int linenumber_t; -#endif - /** Assertion Error. * @author <a href="mailto:ch...@ri...">Christian Hujer</a> */ @@ -132,9 +133,6 @@ /** The id of the test case of the failed assertion. */ TestCaseId_t testId; - /** The line number of the failed assertion. */ - linenumber_t lineNumber; - /** The assertion id. */ AssertionId_t assertionId; @@ -212,10 +210,9 @@ /** Records an error. * @param fixtureId Id of the fixture that contained the test case with the failed assertion. - * @param lineNumber Line number of the assertion that failed. * @param assertionId Id of the assertion that failed. */ -extern void recordError(const FixtureId_t fixtureId, const linenumber_t lineNumber, const AssertionId_t assertionId); +extern void recordError(const FixtureId_t fixtureId, const AssertionId_t assertionId); /** Runs all test cases from a test fixture. * @param fixture Test fixture to run. Modified: trunk/src/native/FullPlainLogger.c =================================================================== --- trunk/src/native/FullPlainLogger.c 2007-10-28 13:39:15 UTC (rev 129) +++ trunk/src/native/FullPlainLogger.c 2007-10-28 14:30:54 UTC (rev 130) @@ -42,6 +42,6 @@ #ifdef ACEUNIT_EMBEDDED #error "FullPlainLogger does not support embedded AceUnit." #else - printf("%s:%d: error: in %s: %s\n", recentError->fixtureId, recentError->lineNumber, recentError->testId, recentError->assertionId); + printf("%s:%d: error: in %s: %s\n", recentError->fixtureId, recentError->assertionId.lineNumber, recentError->testId, recentError->assertionId.message); #endif } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <chr...@us...> - 2007-10-28 13:39:17
|
Revision: 129 http://aceunit.svn.sourceforge.net/aceunit/?rev=129&view=rev Author: christianhujer Date: 2007-10-28 06:39:15 -0700 (Sun, 28 Oct 2007) Log Message: ----------- Simplified code regarding the output of comments. Added test ids for embedded tests. Modified Paths: -------------- trunk/src/java/src/prj/net/sf/aceunit/MethodLists.java Modified: trunk/src/java/src/prj/net/sf/aceunit/MethodLists.java =================================================================== --- trunk/src/java/src/prj/net/sf/aceunit/MethodLists.java 2007-10-28 13:38:23 UTC (rev 128) +++ trunk/src/java/src/prj/net/sf/aceunit/MethodLists.java 2007-10-28 13:39:15 UTC (rev 129) @@ -69,23 +69,17 @@ out.format(" */%n"); out.format("%n"); - out.format("/** The test case ids of this fixture. */%n"); out.format("%s%n", getTestMethodIds()); - out.format("/** The test cases of this fixture. */%n"); - out.format("%s%n", getMethods("testCase", testMethods)); + out.format("%s%n", getMethods("testCase", "test cases", testMethods)); - out.format("/** The before methods of this fixture. */%n"); - out.format("%s%n", getMethods("before", beforeMethods)); + out.format("%s%n", getMethods("before", "before methods", beforeMethods)); - out.format("/** The after methods of this fixture. */%n"); - out.format("%s%n", getMethods("after", afterMethods)); + out.format("%s%n", getMethods("after", "after methods", afterMethods)); - out.format("/** The beforeClass methods of this fixture. */%n"); - out.format("%s%n", getMethods("beforeClass", beforeClassMethods)); + out.format("%s%n", getMethods("beforeClass", "beforeClass methods", beforeClassMethods)); - out.format("/** The afterClass methods of this fixture. */%n"); - out.format("%s%n", getMethods("afterClass", afterClassMethods)); + out.format("%s%n", getMethods("afterClass", "afterClass methods", afterClassMethods)); out.format("/** This fixture. */%n"); out.format("TestFixture_t %sFixture = {%n", basename); @@ -101,11 +95,13 @@ /** Creates a test method list. * @param key Key for which to create the test method list, used as variable name. + * @param title Title to use in comment. * @param methods List with methods to append. * @return Source code for the test methods. */ - private String getMethods(@NotNull final String key, @NotNull final MethodList methods) { + private String getMethods(@NotNull final String key, @NotNull final String title, @NotNull final MethodList methods) { final Formatter out = new Formatter(); + out.format("/** The %s of this fixture. */%n", title); out.format("testMethod_t %s[] = {%n", key); for (final String method : methods) { out.format(" &%s,%n", method); @@ -120,11 +116,20 @@ */ public String getTestMethodIds() { final Formatter out = new Formatter(); + out.format("/** The test case ids of this fixture. */%n"); out.format("TestCaseId_t testId[] = {%n"); + out.format("#if defined(ACEUNIT_EMBEDDED)%n"); + int methodCount = 0; + final String formatString = String.format(" %%%dd, //%%s%%n", (int) (Math.log10(testMethods.size()) + 1)); for (final String method : testMethods) { + out.format(formatString, ++methodCount, method); + } + out.format("#else%n"); + for (final String method : testMethods) { out.format(" \"%s\",%n", method); } out.format(" NULL%n"); + out.format("#endif%n"); out.format("};%n"); return out.toString(); } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <chr...@us...> - 2007-10-28 13:38:19
|
Revision: 128 http://aceunit.svn.sourceforge.net/aceunit/?rev=128&view=rev Author: christianhujer Date: 2007-10-28 06:38:23 -0700 (Sun, 28 Oct 2007) Log Message: ----------- Added size() method to MethodList. Modified Paths: -------------- trunk/src/java/src/prj/net/sf/aceunit/MethodList.java trunk/src/java/src/tst/test/net/sf/aceunit/MethodListTest.java Modified: trunk/src/java/src/prj/net/sf/aceunit/MethodList.java =================================================================== --- trunk/src/java/src/prj/net/sf/aceunit/MethodList.java 2007-10-28 13:06:51 UTC (rev 127) +++ trunk/src/java/src/prj/net/sf/aceunit/MethodList.java 2007-10-28 13:38:23 UTC (rev 128) @@ -108,4 +108,11 @@ return unmodifiableMethodNames; } + /** Returns the number of methods in this methodlist. + * @return Number of methods in this method list. + */ + public int size() { + return methodNames.size(); + } + } // class MethodList Modified: trunk/src/java/src/tst/test/net/sf/aceunit/MethodListTest.java =================================================================== --- trunk/src/java/src/tst/test/net/sf/aceunit/MethodListTest.java 2007-10-28 13:06:51 UTC (rev 127) +++ trunk/src/java/src/tst/test/net/sf/aceunit/MethodListTest.java 2007-10-28 13:38:23 UTC (rev 128) @@ -56,6 +56,7 @@ methodList.findMethods(cSource); Assert.assertTrue(methodList.contains("test1")); Assert.assertEquals(1, methodList.getMethodNames().size()); + Assert.assertEquals(1, methodList.size()); } /** Tests that a method list finds multiple annotated methods. */ @@ -68,6 +69,7 @@ Assert.assertTrue(methodList.contains("test2")); Assert.assertTrue(methodList.contains("test3")); Assert.assertEquals(3, methodList.getMethodNames().size()); + Assert.assertEquals(3, methodList.size()); } /** Tests that a method list finds a single annotated methods even if surrounded by other methods. */ @@ -79,6 +81,7 @@ assertContains(methodList, "test1"); assertNotContains(methodList, "dummy1", "dummy2"); Assert.assertEquals(1, methodList.getMethodNames().size()); + Assert.assertEquals(1, methodList.size()); } /** Tests that a method list finds multiple annotated methods even if surrounded by other methods. */ @@ -90,6 +93,7 @@ assertContains(methodList, "test1", "test2", "test3"); assertNotContains(methodList, "dummy1", "dummy2", "dummy3", "dummy4"); Assert.assertEquals(3, methodList.getMethodNames().size()); + Assert.assertEquals(3, methodList.size()); } /** Tests that removing a method list from another works. */ @@ -143,7 +147,7 @@ * @param methodNames Method names to check. */ private void assertContainsOnly(@NotNull final MethodList methodList, @NotNull final String... methodNames) { - Assert.assertEquals(methodNames.length, methodList.getMethodNames().size()); + Assert.assertEquals(methodNames.length, methodList.size()); for (final String methodName : methodNames) { if (!methodList.contains(methodName)) { Assert.fail("Expected methodList " + methodList + " to contain " + methodName); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <chr...@us...> - 2007-10-28 13:06:51
|
Revision: 127 http://aceunit.svn.sourceforge.net/aceunit/?rev=127&view=rev Author: christianhujer Date: 2007-10-28 06:06:51 -0700 (Sun, 28 Oct 2007) Log Message: ----------- Added comment in output about why it's a header file with program elements. Modified Paths: -------------- trunk/src/java/src/prj/net/sf/aceunit/MethodLists.java Modified: trunk/src/java/src/prj/net/sf/aceunit/MethodLists.java =================================================================== --- trunk/src/java/src/prj/net/sf/aceunit/MethodLists.java 2007-10-27 22:53:08 UTC (rev 126) +++ trunk/src/java/src/prj/net/sf/aceunit/MethodLists.java 2007-10-28 13:06:51 UTC (rev 127) @@ -60,6 +60,10 @@ public String getFixtureCode(@NotNull final String basename) { final Formatter out = new Formatter(); out.format("/** AceUnit test header file for fixture %s.%n", basename); + out.format(" *%n"); + out.format(" * You may wonder why this is a header file and yet generates program elements.%n"); + out.format(" * This allows you to declare test methods as static.%n"); + out.format(" *%n"); out.format(" * @warning This is a generated file. Do not edit. Your changes will be lost.%n"); out.format(" * @file %s.h%n", basename); out.format(" */%n"); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <chr...@us...> - 2007-10-27 22:53:06
|
Revision: 126 http://aceunit.svn.sourceforge.net/aceunit/?rev=126&view=rev Author: christianhujer Date: 2007-10-27 15:53:08 -0700 (Sat, 27 Oct 2007) Log Message: ----------- Added counting test cases and failures. Modified Paths: -------------- trunk/src/native/AceUnit.c trunk/src/native/AceUnitData.c trunk/src/native/test/AceUnitTest.c Modified: trunk/src/native/AceUnit.c =================================================================== --- trunk/src/native/AceUnit.c 2007-10-27 22:08:29 UTC (rev 125) +++ trunk/src/native/AceUnit.c 2007-10-27 22:53:08 UTC (rev 126) @@ -47,6 +47,12 @@ */ extern TestCaseId_t currentTestId; +/** The number of test cases that were executed. */ +extern uint16_t testCaseCount; + +/** The number of test cases that failed. */ +extern uint16_t testCaseFailureCount; + /** Records an error. * @param fixtureId Id of the fixture that contained the test case with the failed assertion. * @param lineNumber Line number of the assertion that failed. @@ -85,8 +91,10 @@ invokeAll(before); recentError = NULL; (*testCase)(); + testCaseCount++; if (NULL != recentError) { FullPlainLoggerLog(recentError); + testCaseFailureCount++; } invokeAll(after); } Modified: trunk/src/native/AceUnitData.c =================================================================== --- trunk/src/native/AceUnitData.c 2007-10-27 22:08:29 UTC (rev 125) +++ trunk/src/native/AceUnitData.c 2007-10-27 22:53:08 UTC (rev 126) @@ -47,3 +47,8 @@ */ TestCaseId_t currentTestId; +/** The number of test cases that were executed. */ +uint16_t testCaseCount; + +/** The number of test cases that failed. */ +uint16_t testCaseFailureCount; Modified: trunk/src/native/test/AceUnitTest.c =================================================================== --- trunk/src/native/test/AceUnitTest.c 2007-10-27 22:08:29 UTC (rev 125) +++ trunk/src/native/test/AceUnitTest.c 2007-10-27 22:53:08 UTC (rev 126) @@ -32,6 +32,7 @@ */ #include <stdbool.h> +#include <stdio.h> #include "AceUnit.h" @@ -229,5 +230,8 @@ */ int main(int argc, char *argv[]) { runFixture(&AceUnitTestFixture); - return 0; + extern uint16_t testCaseCount; + extern uint16_t testCaseFailureCount; + printf("Test Cases: %d Errors: %d\n", testCaseCount, testCaseFailureCount); + return testCaseFailureCount != 0; } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <chr...@us...> - 2007-10-27 22:08:33
|
Revision: 125 http://aceunit.svn.sourceforge.net/aceunit/?rev=125&view=rev Author: christianhujer Date: 2007-10-27 15:08:29 -0700 (Sat, 27 Oct 2007) Log Message: ----------- Updated Doxyfile to doxygen 1.5.3. Modified Paths: -------------- trunk/src/native/Doxyfile Modified: trunk/src/native/Doxyfile =================================================================== --- trunk/src/native/Doxyfile 2007-10-27 21:59:41 UTC (rev 124) +++ trunk/src/native/Doxyfile 2007-10-27 22:08:29 UTC (rev 125) @@ -1,4 +1,4 @@ -# Doxyfile 1.4.6 +# Doxyfile 1.5.3 # This file describes the settings to be used by the documentation system # doxygen (www.doxygen.org) for a project @@ -14,6 +14,14 @@ # Project related configuration options #--------------------------------------------------------------------------- +# This tag specifies the encoding used for all characters in the config file that +# follow. The default is UTF-8 which is also the encoding used for all text before +# the first occurrence of this tag. Doxygen uses libiconv (or the iconv built into +# libc) for the transcoding. See http://www.gnu.org/software/libiconv for the list of +# possible encodings. + +DOXYFILE_ENCODING = UTF-8 + # The PROJECT_NAME tag is a single word (or a sequence of words surrounded # by quotes) that should identify the project. @@ -45,24 +53,14 @@ # documentation generated by doxygen is written. Doxygen will use this # information to generate all constant output in the proper language. # The default language is English, other supported languages are: -# Brazilian, Catalan, Chinese, Chinese-Traditional, Croatian, Czech, Danish, -# Dutch, Finnish, French, German, Greek, Hungarian, Italian, Japanese, -# Japanese-en (Japanese with English messages), Korean, Korean-en, Norwegian, -# Polish, Portuguese, Romanian, Russian, Serbian, Slovak, Slovene, Spanish, -# Swedish, and Ukrainian. +# Afrikaans, Arabic, Brazilian, Catalan, Chinese, Chinese-Traditional, +# Croatian, Czech, Danish, Dutch, Finnish, French, German, Greek, Hungarian, +# Italian, Japanese, Japanese-en (Japanese with English messages), Korean, +# Korean-en, Lithuanian, Norwegian, Polish, Portuguese, Romanian, Russian, +# Serbian, Slovak, Slovene, Spanish, Swedish, and Ukrainian. OUTPUT_LANGUAGE = English -# This tag can be used to specify the encoding used in the generated output. -# The encoding is not always determined by the language that is chosen, -# but also whether or not the output is meant for Windows or non-Windows users. -# In case there is a difference, setting the USE_WINDOWS_ENCODING tag to YES -# forces the Windows encoding (this is the default for the Windows binary), -# whereas setting the tag to NO uses a Unix-style encoding (the default for -# all platforms other than Windows). - -USE_WINDOWS_ENCODING = NO - # If the BRIEF_MEMBER_DESC tag is set to YES (the default) Doxygen will # include brief member descriptions after the members that are listed in # the file and class documentation (similar to JavaDoc). @@ -135,11 +133,19 @@ # If the JAVADOC_AUTOBRIEF tag is set to YES then Doxygen # will interpret the first line (until the first dot) of a JavaDoc-style # comment as the brief description. If set to NO, the JavaDoc -# comments will behave just like the Qt-style comments (thus requiring an -# explicit @brief command for a brief description. +# comments will behave just like regular Qt-style comments +# (thus requiring an explicit @brief command for a brief description.) JAVADOC_AUTOBRIEF = YES +# If the QT_AUTOBRIEF tag is set to YES then Doxygen will +# interpret the first line (until the first dot) of a Qt-style +# comment as the brief description. If set to NO, the comments +# will behave just like regular Qt-style comments (thus requiring +# an explicit \brief command for a brief description.) + +QT_AUTOBRIEF = NO + # The MULTILINE_CPP_IS_BRIEF tag can be set to YES to make Doxygen # treat a multi-line C++ special comment block (i.e. a block of //! or /// # comments) as a brief description. This used to be the default behaviour. @@ -204,6 +210,11 @@ BUILTIN_STL_SUPPORT = NO +# If you use Microsoft's C++/CLI language, you should set this option to YES to +# enable parsing support. + +CPP_CLI_SUPPORT = NO + # If member grouping is used in the documentation and the DISTRIBUTE_GROUP_DOC # tag is set to YES, then doxygen will reuse the documentation of the first # member in the group (if any) for the other members of the group. By default @@ -253,6 +264,13 @@ EXTRACT_LOCAL_METHODS = NO +# If this flag is set to YES, the members of anonymous namespaces will be extracted +# and appear in the documentation as a namespace called 'anonymous_namespace{file}', +# where file will be replaced with the base name of the file that contains the anonymous +# namespace. By default anonymous namespace are hidden. + +EXTRACT_ANON_NSPACES = NO + # If the HIDE_UNDOC_MEMBERS tag is set to YES, Doxygen will hide all # undocumented members of documented classes, files or namespaces. # If set to NO (the default) these members will be included in the @@ -442,7 +460,7 @@ # $version, which will be replaced by the version of the file (if it could # be obtained via FILE_VERSION_FILTER) -WARN_FORMAT = "$file:$line: $text" +WARN_FORMAT = "$file:$line: $text " # The WARN_LOGFILE tag can be used to specify a file to which warning # and error messages should be written. If left blank the output is written @@ -461,6 +479,13 @@ INPUT = +# This tag can be used to specify the character encoding of the source files that +# doxygen parses. Internally doxygen uses the UTF-8 encoding, which is also the default +# input encoding. Doxygen uses libiconv (or the iconv built into libc) for the transcoding. +# See http://www.gnu.org/software/libiconv for the list of possible encodings. + +INPUT_ENCODING = UTF-8 + # If the value of the INPUT tag contains directories, you can use the # FILE_PATTERNS tag to specify one or more wildcard pattern (like *.cpp # and *.h) to filter out the source-files in the directories. If left @@ -496,6 +521,13 @@ EXCLUDE_PATTERNS = +# The EXCLUDE_SYMBOLS tag can be used to specify one or more symbol names +# (namespaces, classes, functions, etc.) that should be excluded from the output. +# The symbol name can be a fully qualified name, a word, or if the wildcard * is used, +# a substring. Examples: ANamespace, AClass, AClass::ANamespace, ANamespace::*Test + +EXCLUDE_SYMBOLS = + # The EXAMPLE_PATH tag can be used to specify one or more files or # directories that contain example code fragments that are included (see # the \include command). @@ -554,7 +586,9 @@ # If the SOURCE_BROWSER tag is set to YES then a list of source files will # be generated. Documented entities will be cross-referenced with these sources. # Note: To get rid of all source code in the generated output, make sure also -# VERBATIM_HEADERS is set to NO. +# VERBATIM_HEADERS is set to NO. If you have enabled CALL_GRAPH or CALLER_GRAPH +# then you must also enable this option. If you don't then doxygen will produce +# a warning and turn it on anyway SOURCE_BROWSER = NO @@ -581,6 +615,13 @@ REFERENCES_RELATION = YES +# If the REFERENCES_LINK_SOURCE tag is set to YES (the default) +# and SOURCE_BROWSER tag is set to YES, then the hyperlinks from +# functions in REFERENCES_RELATION and REFERENCED_BY_RELATION lists will +# link to the source code. Otherwise they will link to the documentstion. + +REFERENCES_LINK_SOURCE = YES + # If the USE_HTAGS tag is set to YES then the references to source code # will point to the HTML generated by the htags(1) tool instead of doxygen # built-in source browser. The htags tool is part of GNU's global source @@ -673,6 +714,14 @@ GENERATE_HTMLHELP = NO +# If the HTML_DYNAMIC_SECTIONS tag is set to YES then the generated HTML +# documentation will contain sections that can be hidden and shown after the +# page has loaded. For this to work a browser that supports +# JavaScript and DHTML is required (for instance Mozilla 1.0+, Firefox +# Netscape 6.0+, Internet explorer 5.0+, Konqueror, or Safari). + +HTML_DYNAMIC_SECTIONS = NO + # If the GENERATE_HTMLHELP tag is set to YES, the CHM_FILE tag can # be used to specify the file name of the resulting .chm file. You # can add a path in front of the file if the result should not be @@ -1078,6 +1127,14 @@ CLASS_DIAGRAMS = YES +# You can define message sequence charts within doxygen comments using the \msc +# command. Doxygen will then run the mscgen tool (see http://www.mcternan.me.uk/mscgen/) to +# produce the chart and insert it in the documentation. The MSCGEN_PATH tag allows you to +# specify the directory where the mscgen tool resides. If left empty the tool is assumed to +# be found in the default search path. + +MSCGEN_PATH = + # If set to YES, the inheritance and collaboration graphs will hide # inheritance and usage relations if the target is undocumented # or is not a class. @@ -1135,7 +1192,7 @@ INCLUDED_BY_GRAPH = YES -# If the CALL_GRAPH and HAVE_DOT tags are set to YES then doxygen will +# If the CALL_GRAPH, SOURCE_BROWSER and HAVE_DOT tags are set to YES then doxygen will # generate a call dependency graph for every global function or class method. # Note that enabling this option will significantly increase the time of a run. # So in most cases it will be better to enable call graphs for selected @@ -1143,6 +1200,14 @@ CALL_GRAPH = NO +# If the CALLER_GRAPH, SOURCE_BROWSER and HAVE_DOT tags are set to YES then doxygen will +# generate a caller dependency graph for every global function or class method. +# Note that enabling this option will significantly increase the time of a run. +# So in most cases it will be better to enable caller graphs for selected +# functions only using the \callergraph command. + +CALLER_GRAPH = NO + # If the GRAPHICAL_HIERARCHY and HAVE_DOT tags are set to YES then doxygen # will graphical hierarchy of all classes instead of a textual one. @@ -1172,31 +1237,23 @@ DOTFILE_DIRS = -# The MAX_DOT_GRAPH_WIDTH tag can be used to set the maximum allowed width -# (in pixels) of the graphs generated by dot. If a graph becomes larger than -# this value, doxygen will try to truncate the graph, so that it fits within -# the specified constraint. Beware that most browsers cannot cope with very -# large images. +# The MAX_DOT_GRAPH_MAX_NODES tag can be used to set the maximum number of +# nodes that will be shown in the graph. If the number of nodes in a graph +# becomes larger than this value, doxygen will truncate the graph, which is +# visualized by representing a node as a red box. Note that doxygen if the number +# of direct children of the root node in a graph is already larger than +# MAX_DOT_GRAPH_NOTES then the graph will not be shown at all. Also note +# that the size of a graph can be further restricted by MAX_DOT_GRAPH_DEPTH. -MAX_DOT_GRAPH_WIDTH = 1024 +DOT_GRAPH_MAX_NODES = 50 -# The MAX_DOT_GRAPH_HEIGHT tag can be used to set the maximum allows height -# (in pixels) of the graphs generated by dot. If a graph becomes larger than -# this value, doxygen will try to truncate the graph, so that it fits within -# the specified constraint. Beware that most browsers cannot cope with very -# large images. - -MAX_DOT_GRAPH_HEIGHT = 1024 - # The MAX_DOT_GRAPH_DEPTH tag can be used to set the maximum depth of the # graphs generated by dot. A depth value of 3 means that only nodes reachable # from the root by following a path via at most 3 edges will be shown. Nodes # that lay further from the root node will be omitted. Note that setting this # option to 1 or 2 may greatly reduce the computation time needed for large -# code bases. Also note that a graph may be further truncated if the graph's -# image dimensions are not sufficient to fit the graph (see MAX_DOT_GRAPH_WIDTH -# and MAX_DOT_GRAPH_HEIGHT). If 0 is used for the depth value (the default), -# the graph is not depth-constrained. +# code bases. Also note that the size of a graph can be further restricted by +# DOT_GRAPH_MAX_NODES. Using a depth of 0 means no depth restriction. MAX_DOT_GRAPH_DEPTH = 0 This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <chr...@us...> - 2007-10-27 21:59:37
|
Revision: 124 http://aceunit.svn.sourceforge.net/aceunit/?rev=124&view=rev Author: christianhujer Date: 2007-10-27 14:59:41 -0700 (Sat, 27 Oct 2007) Log Message: ----------- Added missing file to svn:ignore. 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 runTests AceUnitAnnotations.h + AceUnit.jar FullPlainLogger.c AceUnit.c sortTest.h AceUnit.h runTests AceUnitAnnotations.h AceUnitData.c This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <chr...@us...> - 2007-10-27 21:41:32
|
Revision: 123 http://aceunit.svn.sourceforge.net/aceunit/?rev=123&view=rev Author: christianhujer Date: 2007-10-27 14:41:31 -0700 (Sat, 27 Oct 2007) Log Message: ----------- Moved data into a separate file. Modified Paths: -------------- trunk/src/doc/examples/sort/Makefile trunk/src/native/AceUnit.c trunk/src/native/test/Makefile Added Paths: ----------- trunk/src/native/AceUnitData.c Modified: trunk/src/doc/examples/sort/Makefile =================================================================== --- trunk/src/doc/examples/sort/Makefile 2007-10-27 21:39:57 UTC (rev 122) +++ trunk/src/doc/examples/sort/Makefile 2007-10-27 21:41:31 UTC (rev 123) @@ -1,4 +1,4 @@ -ACE_UNIT_FILES=AceUnit.c AceUnit.h AceUnitAnnotations.h FullPlainLogger.c AceUnit.jar +ACE_UNIT_FILES=AceUnit.c AceUnit.h AceUnitData.c AceUnitAnnotations.h FullPlainLogger.c AceUnit.jar ACE_UNIT_PATH=../../../ @@ -17,6 +17,9 @@ AceUnit.h: $(ACE_UNIT_PATH)/native/AceUnit.h cp $< $@ +AceUnitData.c: $(ACE_UNIT_PATH)/native/AceUnitData.c + cp $< $@ + AceUnitAnnotations.h: $(ACE_UNIT_PATH)/native/AceUnitAnnotations.h cp $< $@ Modified: trunk/src/native/AceUnit.c =================================================================== --- trunk/src/native/AceUnit.c 2007-10-27 21:39:57 UTC (rev 122) +++ trunk/src/native/AceUnit.c 2007-10-27 21:41:31 UTC (rev 123) @@ -37,15 +37,15 @@ * It is set to NULL before each test case. * If it is not NULL after a test case, the test case failed. */ -AssertionError_t *recentError; +extern AssertionError_t *recentError; /** This is the most recent error. */ -AssertionError_t recentErrorData; +extern AssertionError_t recentErrorData; /** The id of the currently executed test case. * This variable will be set by {@link #runFixture()} and read by {@link #recordError()}. */ -TestCaseId_t currentTestId; +extern TestCaseId_t currentTestId; /** Records an error. * @param fixtureId Id of the fixture that contained the test case with the failed assertion. Added: trunk/src/native/AceUnitData.c =================================================================== --- trunk/src/native/AceUnitData.c (rev 0) +++ trunk/src/native/AceUnitData.c 2007-10-27 21:41:31 UTC (rev 123) @@ -0,0 +1,49 @@ +/* Copyright (c) 2007, Christian Hujer + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * * Neither the name of the AceUnit developers nor the + * names of its contributors may be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER + * OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, + * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR + * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF + * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +/** Data module of AceUnit. + * @author <a href="mailto:ch...@ri...">Christian Hujer</a> + * @file AceUnitData.c + */ + +#include "AceUnit.h" + +/** The most recent error will be remembered here. + * This variable will be set by {@link #recordError()} and read by {@link #runFixture()}. + * It is set to NULL before each test case. + * If it is not NULL after a test case, the test case failed. + */ +AssertionError_t *recentError; + +/** This is the most recent error. */ +AssertionError_t recentErrorData; + +/** The id of the currently executed test case. + * This variable will be set by {@link #runFixture()} and read by {@link #recordError()}. + */ +TestCaseId_t currentTestId; + Property changes on: trunk/src/native/AceUnitData.c ___________________________________________________________________ Name: svn:mime-type + text/plain Name: svn:eol-style + native Modified: trunk/src/native/test/Makefile =================================================================== --- trunk/src/native/test/Makefile 2007-10-27 21:39:57 UTC (rev 122) +++ trunk/src/native/test/Makefile 2007-10-27 21:41:31 UTC (rev 123) @@ -1,4 +1,4 @@ -ACE_UNIT_FILES=AceUnit.c AceUnit.h AceUnitAnnotations.h FullPlainLogger.c AceUnit.jar +ACE_UNIT_FILES=AceUnit.c AceUnit.h AceUnitData.c AceUnitAnnotations.h FullPlainLogger.c AceUnit.jar ACE_UNIT_PATH=../../ @@ -17,6 +17,9 @@ AceUnit.h: $(ACE_UNIT_PATH)/native/AceUnit.h cp $< $@ +AceUnitData.c: $(ACE_UNIT_PATH)/native/AceUnitData.c + cp $< $@ + AceUnitAnnotations.h: $(ACE_UNIT_PATH)/native/AceUnitAnnotations.h cp $< $@ This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <chr...@us...> - 2007-10-27 21:39:52
|
Revision: 122 http://aceunit.svn.sourceforge.net/aceunit/?rev=122&view=rev Author: christianhujer Date: 2007-10-27 14:39:57 -0700 (Sat, 27 Oct 2007) Log Message: ----------- Added TODO. Modified Paths: -------------- trunk/src/native/MiniRamLogger.c Modified: trunk/src/native/MiniRamLogger.c =================================================================== --- trunk/src/native/MiniRamLogger.c 2007-10-27 21:31:07 UTC (rev 121) +++ trunk/src/native/MiniRamLogger.c 2007-10-27 21:39:57 UTC (rev 122) @@ -32,6 +32,7 @@ * @file MiniRamLogger.c */ +// TODO: Get rid of these includes. #include <stdio.h> #include <string.h> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <chr...@us...> - 2007-10-27 21:31:04
|
Revision: 121 http://aceunit.svn.sourceforge.net/aceunit/?rev=121&view=rev Author: christianhujer Date: 2007-10-27 14:31:07 -0700 (Sat, 27 Oct 2007) Log Message: ----------- Removed surplus include. Modified Paths: -------------- trunk/src/native/FullPlainLogger.c Modified: trunk/src/native/FullPlainLogger.c =================================================================== --- trunk/src/native/FullPlainLogger.c 2007-10-27 21:25:38 UTC (rev 120) +++ trunk/src/native/FullPlainLogger.c 2007-10-27 21:31:07 UTC (rev 121) @@ -32,7 +32,6 @@ */ #include <stdio.h> -#include <stdlib.h> #include "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-27 21:25:39
|
Revision: 120 http://aceunit.svn.sourceforge.net/aceunit/?rev=120&view=rev Author: christianhujer Date: 2007-10-27 14:25:38 -0700 (Sat, 27 Oct 2007) Log Message: ----------- Fixed doxygen issue. Modified Paths: -------------- trunk/src/native/AceUnit.h Modified: trunk/src/native/AceUnit.h =================================================================== --- trunk/src/native/AceUnit.h 2007-10-27 21:25:12 UTC (rev 119) +++ trunk/src/native/AceUnit.h 2007-10-27 21:25:38 UTC (rev 120) @@ -62,6 +62,7 @@ /** Replacement for stdint.h uint16_t in case stdint.h is not available. */ typedef unsigned short int uint16_t; #ifndef NULL +/** Replacement for stddef.h NULL in case stddef.h is not available. */ #if defined(__cplusplus) #define NULL 0 #else This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <chr...@us...> - 2007-10-27 21:25:09
|
Revision: 119 http://aceunit.svn.sourceforge.net/aceunit/?rev=119&view=rev Author: christianhujer Date: 2007-10-27 14:25:12 -0700 (Sat, 27 Oct 2007) Log Message: ----------- Added coverage metrics (gcov). Modified Paths: -------------- trunk/src/native/test/Makefile Modified: trunk/src/native/test/Makefile =================================================================== --- trunk/src/native/test/Makefile 2007-10-27 21:24:53 UTC (rev 118) +++ trunk/src/native/test/Makefile 2007-10-27 21:25:12 UTC (rev 119) @@ -7,7 +7,7 @@ all: prepare compile test clean: - rm -f $(ACE_UNIT_FILES) $(FIXTURE_NAME).h runTests + rm -f $(ACE_UNIT_FILES) $(FIXTURE_NAME).h runTests *.gcov *.gcno *.gcda prepare: $(ACE_UNIT_FILES) @@ -35,7 +35,13 @@ java -jar AceUnit.jar $(FIXTURE_NAME) >$(FIXTURE_NAME).h runTests: $(FIXTURE_NAME).c $(FIXTURE_NAME).h $(ACE_UNIT_FILES) - $(CC) -Wall -g -o runTests *.c + $(CC) -fprofile-arcs -ftest-coverage -Wall -g -o runTests *.c test: runTests ./runTests + +doc: $(FIXTURE_NAME).c $(FIXTURE_NAME).h $(ACE_UNIT_FILES) + doxygen + +coverage: test + gcov *.c This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <chr...@us...> - 2007-10-27 21:24:54
|
Revision: 118 http://aceunit.svn.sourceforge.net/aceunit/?rev=118&view=rev Author: christianhujer Date: 2007-10-27 14:24:53 -0700 (Sat, 27 Oct 2007) Log Message: ----------- Fixed doxygen issues. Modified Paths: -------------- trunk/src/native/test/AceUnitTest.c Modified: trunk/src/native/test/AceUnitTest.c =================================================================== --- trunk/src/native/test/AceUnitTest.c 2007-10-27 21:02:26 UTC (rev 117) +++ trunk/src/native/test/AceUnitTest.c 2007-10-27 21:24:53 UTC (rev 118) @@ -198,7 +198,7 @@ } } -/** Tests that {@link #assertEquals() with unequal values sets recentError. */ +/** Tests that {@link #assertEquals()} with unequal values sets recentError. */ A_Test void testAssertEqualsWithUnequalSetsRecentError() { bool recentErrorSet = false; int val1 = 10; @@ -219,9 +219,14 @@ #include "AceUnitTest.h" -// Run the tests. -// Note: This is only here temporarily. -// In future versions, this part will be auto-generated. +/** Run the tests. + * @note This is only here temporarily. + * @note Command line arguments currently are ignored. + * In future versions, this part will be auto-generated. + * @param argc Command line argument count. + * @param argv Command line argument values. + * @return Exit status (currently always 0). + */ int main(int argc, char *argv[]) { runFixture(&AceUnitTestFixture); return 0; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <chr...@us...> - 2007-10-27 21:02:23
|
Revision: 117 http://aceunit.svn.sourceforge.net/aceunit/?rev=117&view=rev Author: christianhujer Date: 2007-10-27 14:02:26 -0700 (Sat, 27 Oct 2007) Log Message: ----------- Removed include of <stddef.h>. No longer needed. Modified Paths: -------------- trunk/src/native/test/AceUnitTest.c Modified: trunk/src/native/test/AceUnitTest.c =================================================================== --- trunk/src/native/test/AceUnitTest.c 2007-10-27 20:46:16 UTC (rev 116) +++ trunk/src/native/test/AceUnitTest.c 2007-10-27 21:02:26 UTC (rev 117) @@ -32,7 +32,6 @@ */ #include <stdbool.h> -#include <stddef.h> #include "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-27 20:46:21
|
Revision: 116 http://aceunit.svn.sourceforge.net/aceunit/?rev=116&view=rev Author: christianhujer Date: 2007-10-27 13:46:16 -0700 (Sat, 27 Oct 2007) Log Message: ----------- Extended switch to use ISO includes. AceUnit should now be able to run without additional includes. Modified Paths: -------------- trunk/src/native/AceUnit.c trunk/src/native/AceUnit.h Modified: trunk/src/native/AceUnit.c =================================================================== --- trunk/src/native/AceUnit.c 2007-10-27 20:20:24 UTC (rev 115) +++ trunk/src/native/AceUnit.c 2007-10-27 20:46:16 UTC (rev 116) @@ -30,9 +30,6 @@ * @file AceUnit.c */ -// TODO: Get rid of this include. AceUnit.c should not require system includes. -#include <stddef.h> - #include "AceUnit.h" /** The most recent error will be remembered here. Modified: trunk/src/native/AceUnit.h =================================================================== --- trunk/src/native/AceUnit.h 2007-10-27 20:20:24 UTC (rev 115) +++ trunk/src/native/AceUnit.h 2007-10-27 20:46:16 UTC (rev 116) @@ -34,10 +34,15 @@ * Define this macro if you want to use AceUnit in embedded mode. * Using AceUnit in embedded mode will use test element ids that are <code>uint16_t</code> instead of <code>char*</code>. * </dd> - * <dt><code>ACEUNIT_EMBEDDED_C99</code></dt> + * <dt><code>ACEUNIT_C99</code></dt> * <dd> - * Define this macro if you use AceUnit in embedded mode and have full C99 (including <code><stdint.h></code>) available. - * AceUnit uses this macro to determine whether to include <code><stdint.h></code> to get <code>uint16_t</code> or use its own definition. + * Define this macro if you use AceUnit and have full C99 (including <code><stdint.h></code>) available. + * AceUnit uses this macro to determine whether to include some standard header files or use its own definitions. + * This includes: + * <ul> + * <li><code><stdint.h></code> for <code>uint16_t</code></li> + * <li><code><stddef.h></code> for <code>NULL</code></li> + * </ul> * </dd> * <dt><code>ACEUNIT_STATIC_ANNOTATIONS</code></dt> * <dd> @@ -50,14 +55,20 @@ * @author <a href="mailto:ch...@ri...">Christian Hujer</a> * @file AceUnit.h */ -#ifdef ACEUNIT_EMBEDDED -#if defined(__STDC_VERSION__) && (__STDC_VERSION__ >= 19901L) && defined(ACEUNIT_EMBEDDED_C99) +#if defined(__STDC_VERSION__) && (__STDC_VERSION__ >= 19901L) && defined(ACEUNIT_C99) +#include <stddef.h> #include <stdint.h> #else /** Replacement for stdint.h uint16_t in case stdint.h is not available. */ typedef unsigned short int uint16_t; +#ifndef NULL +#if defined(__cplusplus) +#define NULL 0 +#else +#define NULL ((void *) 0) #endif #endif +#endif #include "AceUnitAnnotations.h" This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <chr...@us...> - 2007-10-27 20:20:23
|
Revision: 115 http://aceunit.svn.sourceforge.net/aceunit/?rev=115&view=rev Author: christianhujer Date: 2007-10-27 13:20:24 -0700 (Sat, 27 Oct 2007) Log Message: ----------- Changed recent error to not require malloc / free. Modified Paths: -------------- trunk/src/native/AceUnit.c trunk/src/native/test/AceUnitTest.c Modified: trunk/src/native/AceUnit.c =================================================================== --- trunk/src/native/AceUnit.c 2007-10-27 19:57:36 UTC (rev 114) +++ trunk/src/native/AceUnit.c 2007-10-27 20:20:24 UTC (rev 115) @@ -31,15 +31,20 @@ */ // TODO: Get rid of this include. AceUnit.c should not require system includes. -#include <stdlib.h> +#include <stddef.h> #include "AceUnit.h" /** The most recent error will be remembered here. * This variable will be set by {@link #recordError()} and read by {@link #runFixture()}. + * It is set to NULL before each test case. + * If it is not NULL after a test case, the test case failed. */ AssertionError_t *recentError; +/** This is the most recent error. */ +AssertionError_t recentErrorData; + /** The id of the currently executed test case. * This variable will be set by {@link #runFixture()} and read by {@link #recordError()}. */ @@ -51,7 +56,7 @@ * @param assertionId Id of the assertion that failed. */ void recordError(const FixtureId_t fixtureId, const linenumber_t lineNumber, const AssertionId_t assertionId) { - recentError = malloc(sizeof(AssertionError_t)); + recentError = &recentErrorData; recentError->fixtureId = fixtureId; recentError->lineNumber = lineNumber; recentError->assertionId = assertionId; @@ -85,7 +90,6 @@ (*testCase)(); if (NULL != recentError) { FullPlainLoggerLog(recentError); - free(recentError); } invokeAll(after); } Modified: trunk/src/native/test/AceUnitTest.c =================================================================== --- trunk/src/native/test/AceUnitTest.c 2007-10-27 19:57:36 UTC (rev 114) +++ trunk/src/native/test/AceUnitTest.c 2007-10-27 20:20:24 UTC (rev 115) @@ -32,16 +32,15 @@ */ #include <stdbool.h> -#include <stdlib.h> +#include <stddef.h> #include "AceUnit.h" extern AssertionError_t* recentError; -/** Clears and frees the current recent error. */ +/** Clears the current recent error. */ void clearRecentError() { if (recentError != NULL) { - free(recentError); recentError = NULL; } } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <chr...@us...> - 2007-10-27 19:57:33
|
Revision: 114 http://aceunit.svn.sourceforge.net/aceunit/?rev=114&view=rev Author: christianhujer Date: 2007-10-27 12:57:36 -0700 (Sat, 27 Oct 2007) Log Message: ----------- Added test cases for assertEquals(). Modified Paths: -------------- trunk/src/native/test/AceUnitTest.c Modified: trunk/src/native/test/AceUnitTest.c =================================================================== --- trunk/src/native/test/AceUnitTest.c 2007-10-27 17:11:42 UTC (rev 113) +++ trunk/src/native/test/AceUnitTest.c 2007-10-27 19:57:36 UTC (rev 114) @@ -56,7 +56,7 @@ helper(); clearRecentError(); if (!assertionContinued) { - fail("Expected assertion to continue."); + fail("Expected assertTrue(msg, true) to continue."); } } @@ -70,7 +70,7 @@ helper(); clearRecentError(); if (assertionContinued) { - fail("Expected assertion to not continue."); + fail("Expected assertTrue(msg, false) to not continue."); } } @@ -79,7 +79,8 @@ clearRecentError(); assertTrue("assertTrue(msg, true) MUST NOT set recentError.", true); if (recentError != NULL) { - fail("Expected recentError to be NULL."); + clearRecentError(); + fail("Expected assertTrue(msg, true) to not set recentError."); } } @@ -96,7 +97,7 @@ } clearRecentError(); if (!recentErrorSet) { - fail("Expected recentError to be set."); + fail("Expected assertTrue(msg, false) to set recentError."); } } @@ -133,6 +134,7 @@ clearRecentError(); assertFalse("assertFalse(msg, false) MUST NOT set recentError.", false); if (recentError != NULL) { + clearRecentError(); fail("Expected recentError to be NULL."); } } @@ -154,6 +156,69 @@ } } +/** Tests that {@link #assertEquals()} with equal values continues a test case. */ +A_Test void testAssertEqualsWithEqualContinues() { + bool assertionContinued = false; + int val1 = 10; + int val2 = val1; + void helper() { + assertEquals("assertEquals(msg, val, val) MUST continue the test case.", val1, val2); + assertionContinued = true; + } + helper(); + clearRecentError(); + if (!assertionContinued) { + fail("Expected assertion to continue."); + } +} + +/** Tests that {@link #assertEquals()} with unequal values does not continue a test case. */ +A_Test void testAssertEqualsWithUnequalReturns() { + bool assertionContinued = false; + int val1 = 10; + int val2 = 20; + void helper() { + assertEquals("assertEquals(msg, val1, val2) MUST NOT continue the test case.", val1, val2); + assertionContinued = true; + } + helper(); + clearRecentError(); + if (assertionContinued) { + fail("Expected assertion to not continue."); + } +} + +/** Tests that {@link #assertEquals()} with equal values does not set recentError. */ +A_Test void testAssertEqualsWithEqualNoRecentError() { + int val1 = 10; + int val2 = val1; + clearRecentError(); + assertEquals("assertEquals(msg, val1, val2) MUST NOT set recentError.", val1, val2); + if (recentError != NULL) { + clearRecentError(); + fail("Expected recentError to be NULL."); + } +} + +/** Tests that {@link #assertEquals() with unequal values sets recentError. */ +A_Test void testAssertEqualsWithUnequalSetsRecentError() { + bool recentErrorSet = false; + int val1 = 10; + int val2 = 20; + clearRecentError(); + void helper() { + assertEquals("Test assertion, expected to fail.", val1, val2); + } + helper(); + if (recentError != NULL) { + recentErrorSet = true; + } + clearRecentError(); + if (!recentErrorSet) { + fail("Expected recentError to be set."); + } +} + #include "AceUnitTest.h" // Run the tests. This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <chr...@us...> - 2007-10-27 17:11:38
|
Revision: 113 http://aceunit.svn.sourceforge.net/aceunit/?rev=113&view=rev Author: christianhujer Date: 2007-10-27 10:11:42 -0700 (Sat, 27 Oct 2007) Log Message: ----------- Improved output of AceUnit.jar. It now will generate files with the underlying platform's line ending instead of UNIX only. Also added comments to the generated header file. Modified Paths: -------------- trunk/src/java/src/prj/net/sf/aceunit/MethodLists.java Modified: trunk/src/java/src/prj/net/sf/aceunit/MethodLists.java =================================================================== --- trunk/src/java/src/prj/net/sf/aceunit/MethodLists.java 2007-10-27 17:11:02 UTC (rev 112) +++ trunk/src/java/src/prj/net/sf/aceunit/MethodLists.java 2007-10-27 17:11:42 UTC (rev 113) @@ -2,6 +2,7 @@ import java.util.Arrays; import java.util.Collection; +import java.util.Formatter; import java.util.List; import org.jetbrains.annotations.NotNull; @@ -57,44 +58,71 @@ * @return String with the C-Source for the fixture. */ public String getFixtureCode(@NotNull final String basename) { - final StringBuilder out = new StringBuilder(); - out.append(getTestMethodIds()); - out.append(getMethods("testCase", testMethods)); - out.append(getMethods("before", beforeMethods)); - out.append(getMethods("after", afterMethods)); - out.append(getMethods("beforeClass", beforeClassMethods)); - out.append(getMethods("afterClass", afterClassMethods)); - out.append("\n"); - out.append("TestFixture_t ").append(basename).append("Fixture = {\n testId,\n testCase,\n before,\n after,\n beforeClass,\n afterClass\n};\n\n"); + final Formatter out = new Formatter(); + out.format("/** AceUnit test header file for fixture %s.%n", basename); + out.format(" * @warning This is a generated file. Do not edit. Your changes will be lost.%n"); + out.format(" * @file %s.h%n", basename); + out.format(" */%n"); + out.format("%n"); + + out.format("/** The test case ids of this fixture. */%n"); + out.format("%s%n", getTestMethodIds()); + + out.format("/** The test cases of this fixture. */%n"); + out.format("%s%n", getMethods("testCase", testMethods)); + + out.format("/** The before methods of this fixture. */%n"); + out.format("%s%n", getMethods("before", beforeMethods)); + + out.format("/** The after methods of this fixture. */%n"); + out.format("%s%n", getMethods("after", afterMethods)); + + out.format("/** The beforeClass methods of this fixture. */%n"); + out.format("%s%n", getMethods("beforeClass", beforeClassMethods)); + + out.format("/** The afterClass methods of this fixture. */%n"); + out.format("%s%n", getMethods("afterClass", afterClassMethods)); + + out.format("/** This fixture. */%n"); + out.format("TestFixture_t %sFixture = {%n", basename); + out.format(" testId,%n"); + out.format(" testCase,%n"); + out.format(" before,%n"); + out.format(" after,%n"); + out.format(" beforeClass,%n"); + out.format(" afterClass%n"); + out.format("};%n"); return out.toString(); } - /** Appends the method list to the specified output. - * @param key Key for which to append the method list, used as variable name. + /** Creates a test method list. + * @param key Key for which to create the test method list, used as variable name. * @param methods List with methods to append. * @return Source code for the test methods. */ private String getMethods(@NotNull final String key, @NotNull final MethodList methods) { - final StringBuilder sb = new StringBuilder(); - sb.append("testMethod_t ").append(key).append("[] = {\n"); + final Formatter out = new Formatter(); + out.format("testMethod_t %s[] = {%n", key); for (final String method : methods) { - sb.append(" &").append(method).append(",\n"); + out.format(" &%s,%n", method); } - sb.append(" NULL\n};\n"); - return sb.toString(); + out.format(" NULL%n"); + out.format("};%n"); + return out.toString(); } /** Returns a String with the source code for the test method ids. * @return Source code for the test method ids. */ public String getTestMethodIds() { - final StringBuilder sb = new StringBuilder(); - sb.append("TestCaseId_t testId[] = {\n"); + final Formatter out = new Formatter(); + out.format("TestCaseId_t testId[] = {%n"); for (final String method : testMethods) { - sb.append(" \"").append(method).append("\","); + out.format(" \"%s\",%n", method); } - sb.append(" NULL\n};\n"); - return sb.toString(); + out.format(" NULL%n"); + out.format("};%n"); + return out.toString(); } } // class MethodLists This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <chr...@us...> - 2007-10-27 17:11:03
|
Revision: 112 http://aceunit.svn.sourceforge.net/aceunit/?rev=112&view=rev Author: christianhujer Date: 2007-10-27 10:11:02 -0700 (Sat, 27 Oct 2007) Log Message: ----------- Updated IntelliJ IDEA project file to 7.0. Modified Paths: -------------- trunk/src/java/AceUnit.ipr Modified: trunk/src/java/AceUnit.ipr =================================================================== --- trunk/src/java/AceUnit.ipr 2007-10-27 14:55:28 UTC (rev 111) +++ trunk/src/java/AceUnit.ipr 2007-10-27 17:11:02 UTC (rev 112) @@ -275,6 +275,7 @@ <component name="VcsDirectoryMappings"> <mapping directory="" vcs="svn" /> </component> + <component name="WebServicesPlugin" addRequiredLibraries="true" /> <component name="com.intellij.jsf.UserDefinedFacesConfigs"> <option name="USER_DEFINED_CONFIGS"> <value> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <chr...@us...> - 2007-10-27 14:55:31
|
Revision: 111 http://aceunit.svn.sourceforge.net/aceunit/?rev=111&view=rev Author: christianhujer Date: 2007-10-27 07:55:28 -0700 (Sat, 27 Oct 2007) Log Message: ----------- Changed embedded mode to not require C99. Added some doxygen comments about the possible configuration macros. Modified Paths: -------------- trunk/README trunk/src/native/AceUnit.h Modified: trunk/README =================================================================== --- trunk/README 2007-10-27 14:31:39 UTC (rev 110) +++ trunk/README 2007-10-27 14:55:28 UTC (rev 111) @@ -18,8 +18,7 @@ REQUIREMENTS ============ Java 1.5 is required for the generator. -C99 is required if you use AceUnit embedded. (This will change to C89 soon) -C89 is required if you use AceUnit normally. +C89 is required for AceUnit. DIRECTORY STRUCTURE Modified: trunk/src/native/AceUnit.h =================================================================== --- trunk/src/native/AceUnit.h 2007-10-27 14:31:39 UTC (rev 110) +++ trunk/src/native/AceUnit.h 2007-10-27 14:55:28 UTC (rev 111) @@ -26,16 +26,36 @@ */ /** AceUnit header file. + * When using AceUnit, this is the header file that you need to include in your test fixtures. + * The following options are supported: + * <dl> + * <dt><code>ACEUNIT_EMBEDDED</code></dt> + * <dd> + * Define this macro if you want to use AceUnit in embedded mode. + * Using AceUnit in embedded mode will use test element ids that are <code>uint16_t</code> instead of <code>char*</code>. + * </dd> + * <dt><code>ACEUNIT_EMBEDDED_C99</code></dt> + * <dd> + * Define this macro if you use AceUnit in embedded mode and have full C99 (including <code><stdint.h></code>) available. + * AceUnit uses this macro to determine whether to include <code><stdint.h></code> to get <code>uint16_t</code> or use its own definition. + * </dd> + * <dt><code>ACEUNIT_STATIC_ANNOTATIONS</code></dt> + * <dd> + * Define this macro if you want AceUnit annotations (#A_Test, #A_Before, #A_After, #A_BeforeClass, #A_AfterClass, #A_Ignore, #A_IgnoreR) to behave like the <code>static</code> keyword. + * The advantage of having <code>static</code> annotations is that you will be safe from naming conflicts amongst your test cases. + * The disadvantage is that depending on your tool chain, your linker might not generate all desired debugging information for <code>static</code> functions. + * If you're unsure, a rule of thumb is define either <code>ACEUNIT_EMBEDDED</code> or <code>ACEUNIT_STATIC_ANNOTATIONS</code> but not both. + * </dd> + * </dl> * @author <a href="mailto:ch...@ri...">Christian Hujer</a> * @file AceUnit.h */ #ifdef ACEUNIT_EMBEDDED -#if defined(__STDC_VERSION__) && (__STDC_VERSION__ >= 19901L) -// TODO AceUnit.h should not require system includes. +#if defined(__STDC_VERSION__) && (__STDC_VERSION__ >= 19901L) && defined(ACEUNIT_EMBEDDED_C99) #include <stdint.h> #else -#error "AceUnit does not yet support old C compilers (prior C99) in embedded mode." -// TODO: change that. +/** Replacement for stdint.h uint16_t in case stdint.h is not available. */ +typedef unsigned short int uint16_t; #endif #endif This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <chr...@us...> - 2007-10-27 14:31:36
|
Revision: 110 http://aceunit.svn.sourceforge.net/aceunit/?rev=110&view=rev Author: christianhujer Date: 2007-10-27 07:31:39 -0700 (Sat, 27 Oct 2007) Log Message: ----------- Updated README. Modified Paths: -------------- trunk/README Modified: trunk/README =================================================================== --- trunk/README 2007-10-25 22:20:46 UTC (rev 109) +++ trunk/README 2007-10-27 14:31:39 UTC (rev 110) @@ -14,10 +14,16 @@ design but is worth noting explicitely, as this is what distinguishes this framework most from other frameworks for unit testing C code. - + +REQUIREMENTS +============ +Java 1.5 is required for the generator. +C99 is required if you use AceUnit embedded. (This will change to C89 soon) +C89 is required if you use AceUnit normally. + + DIRECTORY STRUCTURE =================== - src/doc The source code of the documentation. This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <chr...@us...> - 2007-10-25 22:20:42
|
Revision: 109 http://aceunit.svn.sourceforge.net/aceunit/?rev=109&view=rev Author: christianhujer Date: 2007-10-25 15:20:46 -0700 (Thu, 25 Oct 2007) Log Message: ----------- Added TODOs about removing system includes in the main files. Modified Paths: -------------- trunk/src/native/AceUnit.c trunk/src/native/AceUnit.h Modified: trunk/src/native/AceUnit.c =================================================================== --- trunk/src/native/AceUnit.c 2007-10-25 22:19:17 UTC (rev 108) +++ trunk/src/native/AceUnit.c 2007-10-25 22:20:46 UTC (rev 109) @@ -30,6 +30,7 @@ * @file AceUnit.c */ +// TODO: Get rid of this include. AceUnit.c should not require system includes. #include <stdlib.h> #include "AceUnit.h" Modified: trunk/src/native/AceUnit.h =================================================================== --- trunk/src/native/AceUnit.h 2007-10-25 22:19:17 UTC (rev 108) +++ trunk/src/native/AceUnit.h 2007-10-25 22:20:46 UTC (rev 109) @@ -31,6 +31,7 @@ */ #ifdef ACEUNIT_EMBEDDED #if defined(__STDC_VERSION__) && (__STDC_VERSION__ >= 19901L) +// TODO AceUnit.h should not require system includes. #include <stdint.h> #else #error "AceUnit does not yet support old C compilers (prior C99) in embedded mode." This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <chr...@us...> - 2007-10-25 22:19:14
|
Revision: 108 http://aceunit.svn.sourceforge.net/aceunit/?rev=108&view=rev Author: christianhujer Date: 2007-10-25 15:19:17 -0700 (Thu, 25 Oct 2007) Log Message: ----------- Removed unused includes. Modified Paths: -------------- trunk/src/native/AceUnit.c Modified: trunk/src/native/AceUnit.c =================================================================== --- trunk/src/native/AceUnit.c 2007-10-25 22:15:28 UTC (rev 107) +++ trunk/src/native/AceUnit.c 2007-10-25 22:19:17 UTC (rev 108) @@ -30,9 +30,7 @@ * @file AceUnit.c */ -#include <stdio.h> #include <stdlib.h> -#include <stdbool.h> #include "AceUnit.h" This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |