aceunit-commit Mailing List for AceUnit (Page 11)
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...> - 2008-03-18 22:49:37
|
Revision: 333 http://aceunit.svn.sourceforge.net/aceunit/?rev=333&view=rev Author: christianhujer Date: 2008-03-18 15:49:34 -0700 (Tue, 18 Mar 2008) Log Message: ----------- [ 1918878 ] Documentation can not be generated Modified Paths: -------------- trunk/src/doc/build.xml Added Paths: ----------- trunk/src/doc/lib/ trunk/src/doc/lib/megaxslt.jar Modified: trunk/src/doc/build.xml =================================================================== --- trunk/src/doc/build.xml 2008-02-28 22:27:45 UTC (rev 332) +++ trunk/src/doc/build.xml 2008-03-18 22:49:34 UTC (rev 333) @@ -35,7 +35,11 @@ <property file="developer.properties" /> <property file="project.properties" /> - <taskdef name="megaxslt" classname="com.hujer.ant.tasks.megaxslt.MegaXsltTask" /> + <taskdef name="megaxslt" classname="com.hujer.ant.tasks.megaxslt.MegaXsltTask"> + <classpath> + <pathelement location="lib/megaxslt.jar" /> + </classpath> + </taskdef> &catalogForAnt; Added: trunk/src/doc/lib/megaxslt.jar =================================================================== (Binary files differ) Property changes on: trunk/src/doc/lib/megaxslt.jar ___________________________________________________________________ Name: svn:mime-type + application/octet-stream This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <chr...@us...> - 2008-02-28 22:27:43
|
Revision: 332 http://aceunit.svn.sourceforge.net/aceunit/?rev=332&view=rev Author: christianhujer Date: 2008-02-28 14:27:45 -0800 (Thu, 28 Feb 2008) Log Message: ----------- Fixed Makefile. It masked errors away. Modified Paths: -------------- trunk/src/native/test/xmlLog/Makefile Modified: trunk/src/native/test/xmlLog/Makefile =================================================================== --- trunk/src/native/test/xmlLog/Makefile 2008-02-28 22:07:10 UTC (rev 331) +++ trunk/src/native/test/xmlLog/Makefile 2008-02-28 22:27:45 UTC (rev 332) @@ -52,7 +52,7 @@ # $(CC) -std=c89 -pedantic -fprofile-arcs -ftest-coverage -Wall -g -DACEUNIT_EMBEDDED -o runTests *.c test: runTests - ./runTests ; echo $$? ; true + ./runTests doc: $(FIXTURE_NAME).c $(FIXTURE_NAME).h $(ACE_UNIT_FILES) doxygen This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <chr...@us...> - 2008-02-28 22:07:07
|
Revision: 331 http://aceunit.svn.sourceforge.net/aceunit/?rev=331&view=rev Author: christianhujer Date: 2008-02-28 14:07:10 -0800 (Thu, 28 Feb 2008) Log Message: ----------- Fixed confusing error message. Modified Paths: -------------- trunk/src/native/test/xmlLog/XmlLogTest.c Modified: trunk/src/native/test/xmlLog/XmlLogTest.c =================================================================== --- trunk/src/native/test/xmlLog/XmlLogTest.c 2008-02-22 00:18:00 UTC (rev 330) +++ trunk/src/native/test/xmlLog/XmlLogTest.c 2008-02-28 22:07:10 UTC (rev 331) @@ -57,8 +57,8 @@ globalLogger->runnerStarted(); runFixture(&XmlLogTestFixture); globalLogger->runnerEnded(); - if (runnerData->testCaseFailureCount != 0) { - fprintf(stderr, "Test Cases: %d Errors: %d\n", runnerData->testCaseCount, runnerData->testCaseFailureCount); + if (runnerData->testCaseFailureCount != 1) { + fprintf(stderr, "Test Cases: %d Expected Errors: 1 Errors: %d\n", runnerData->testCaseCount, runnerData->testCaseFailureCount); return 1; } return 0; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <chr...@us...> - 2008-02-22 00:17:57
|
Revision: 330 http://aceunit.svn.sourceforge.net/aceunit/?rev=330&view=rev Author: christianhujer Date: 2008-02-21 16:18:00 -0800 (Thu, 21 Feb 2008) Log Message: ----------- Changed prjcheck to issue line numbers in case of errors or warnings. Modified Paths: -------------- trunk/prjcheck Modified: trunk/prjcheck =================================================================== --- trunk/prjcheck 2008-02-10 19:26:47 UTC (rev 329) +++ trunk/prjcheck 2008-02-22 00:18:00 UTC (rev 330) @@ -1,6 +1,6 @@ #!/bin/sh -if find src -name "*.h" -or -name "*.c" -or -name "*.java" | xargs grep ' $' +if find src -name "*.h" -or -name "*.c" -or -name "*.java" | xargs grep -n ' $' then echo Error, above files contain trailing whitespace. exit 1 This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <chr...@us...> - 2008-02-10 19:26:41
|
Revision: 329 http://aceunit.svn.sourceforge.net/aceunit/?rev=329&view=rev Author: christianhujer Date: 2008-02-10 11:26:47 -0800 (Sun, 10 Feb 2008) Log Message: ----------- Added missing comments for tracker relationships. Modified Paths: -------------- trunk/src/java/src/tst/test/net/sf/aceunit/CommentToWhitespaceReaderTest.java Modified: trunk/src/java/src/tst/test/net/sf/aceunit/CommentToWhitespaceReaderTest.java =================================================================== --- trunk/src/java/src/tst/test/net/sf/aceunit/CommentToWhitespaceReaderTest.java 2008-02-10 19:20:19 UTC (rev 328) +++ trunk/src/java/src/tst/test/net/sf/aceunit/CommentToWhitespaceReaderTest.java 2008-02-10 19:26:47 UTC (rev 329) @@ -36,6 +36,7 @@ /** Tests that NoCommentReader replaces comments with whitespace. * @author <a href="mailto:ch...@ri...">Christian Hujer</a> + * @see <a href="https://sourceforge.net/tracker/index.php?func=detail&aid=1864061&group_id=207094&atid=1000227">[ 1864061 ] Java Generator does not recognize comments -> linker problem</a> */ public class CommentToWhitespaceReaderTest { @@ -99,6 +100,7 @@ /** Tests that a single slash at the end of a file is not removed. * @throws IOException In case of I/O problems (unexpected). + * @see <a href="https://sourceforge.net/tracker/index.php?func=detail&aid=1879533&group_id=207094&atid=1000227">[ 1879533 ] missing EOL at EOF makes Generator run out of heap space</a> */ @Test public void slashAtEndOfFile() throws IOException { final String orig = "someCode(); /"; @@ -125,6 +127,7 @@ /** Tests that an incomplete last line works. * @throws IOException In case of I/O problems (unexpected). + * @see <a href="https://sourceforge.net/tracker/index.php?func=detail&aid=1879533&group_id=207094&atid=1000227">[ 1879533 ] missing EOL at EOF makes Generator run out of heap space</a> */ @Test public void incompleteLastLine() throws IOException { final String orig = "void foo() { }"; @@ -134,6 +137,7 @@ /** Tests that an incomplete last line with multiline comment works. * @throws IOException In case of I/O problems (unexpected). + * @see <a href="https://sourceforge.net/tracker/index.php?func=detail&aid=1879533&group_id=207094&atid=1000227">[ 1879533 ] missing EOL at EOF makes Generator run out of heap space</a> */ @Test public void incompleteLastLineWithMultilineComment() throws IOException { final String orig = "/* foo */"; @@ -143,6 +147,7 @@ /** Tests that an incomplete last line with EOL comment works. * @throws IOException In case of I/O problems (unexpected). + * @see <a href="https://sourceforge.net/tracker/index.php?func=detail&aid=1879533&group_id=207094&atid=1000227">[ 1879533 ] missing EOL at EOF makes Generator run out of heap space</a> */ @Test public void incompleteLastLineWithEOLComment() throws IOException { final String orig = "// foo"; @@ -152,6 +157,7 @@ /** Tests that an incomplete multiline comment works. * @throws IOException In case of I/O problems (unexpected). + * @see <a href="https://sourceforge.net/tracker/index.php?func=detail&aid=1879533&group_id=207094&atid=1000227">[ 1879533 ] missing EOL at EOF makes Generator run out of heap space</a> */ @Test public void incompleteMultilineComment() throws IOException { final String orig = "/* "; @@ -161,6 +167,7 @@ /** Tests that an incomplete multiline comment works. * @throws IOException In case of I/O problems (unexpected). + * @see <a href="https://sourceforge.net/tracker/index.php?func=detail&aid=1879533&group_id=207094&atid=1000227">[ 1879533 ] missing EOL at EOF makes Generator run out of heap space</a> */ @Test public void incompleteString() throws IOException { final String orig = "\"xxx"; @@ -170,6 +177,7 @@ /** Tests that an incomplete multiline comment works. * @throws IOException In case of I/O problems (unexpected). + * @see <a href="https://sourceforge.net/tracker/index.php?func=detail&aid=1879533&group_id=207094&atid=1000227">[ 1879533 ] missing EOL at EOF makes Generator run out of heap space</a> */ @Test public void incompleteChar() throws IOException { final String orig = "'x"; @@ -179,6 +187,7 @@ /** Tests that an incomplete multiline comment works. * @throws IOException In case of I/O problems (unexpected). + * @see <a href="https://sourceforge.net/tracker/index.php?func=detail&aid=1879533&group_id=207094&atid=1000227">[ 1879533 ] missing EOL at EOF makes Generator run out of heap space</a> */ @Test public void incompleteEscape() throws IOException { final String orig = "\\"; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <chr...@us...> - 2008-02-10 19:20:14
|
Revision: 328 http://aceunit.svn.sourceforge.net/aceunit/?rev=328&view=rev Author: christianhujer Date: 2008-02-10 11:20:19 -0800 (Sun, 10 Feb 2008) Log Message: ----------- [ 1887942 ] Java Generator does not detect wrongly formatted test source Modified Paths: -------------- trunk/src/java/src/tst/test/net/sf/aceunit/MethodListTest.java Modified: trunk/src/java/src/tst/test/net/sf/aceunit/MethodListTest.java =================================================================== --- trunk/src/java/src/tst/test/net/sf/aceunit/MethodListTest.java 2008-02-10 16:57:09 UTC (rev 327) +++ trunk/src/java/src/tst/test/net/sf/aceunit/MethodListTest.java 2008-02-10 19:20:19 UTC (rev 328) @@ -130,6 +130,38 @@ Assert.assertEquals(3, foundMethods.size()); } + /** Tests that a method is also detected if it is missing its return type. + * @see <a href="https://sourceforge.net/tracker/index.php?func=detail&aid=1887942&group_id=207094&atid=1000227">[ 1887942 ] Java Generator does not detect wrongly formatted test source</a> + */ + @Test + public void testMethodWithoutReturnType() { + final MethodList methodList = MethodList.createTestMethodList(); + final String cSource = "A_Test test1() {}"; + methodList.findMethods(cSource); + final List<String> foundMethods = new ArrayList<String>(); + for (final String methodName : methodList) { + foundMethods.add(methodName); + } + Assert.assertTrue(foundMethods.contains("test1")); + Assert.assertEquals(1, foundMethods.size()); + } + + /** Tests that a method is also detected if its prototype spans several lines. + * @see <a href="https://sourceforge.net/tracker/index.php?func=detail&aid=1887942&group_id=207094&atid=1000227">[ 1887942 ] Java Generator does not detect wrongly formatted test source</a> + */ + @Test + public void testMethodWithMultilinePrototype() { + final MethodList methodList = MethodList.createTestMethodList(); + final String cSource = "A_Test\nstatic\ninline\nvoid\ntest1\n(\n)\n\n{\n}"; + methodList.findMethods(cSource); + final List<String> foundMethods = new ArrayList<String>(); + for (final String methodName : methodList) { + foundMethods.add(methodName); + } + Assert.assertTrue(foundMethods.contains("test1")); + Assert.assertEquals(1, foundMethods.size()); + } + /** Asserts that a method list contains (at least) the specified method names. * @param methodList Method list to check. * @param methodNames Method names to check. This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <chr...@us...> - 2008-02-10 16:57:10
|
Revision: 327 http://aceunit.svn.sourceforge.net/aceunit/?rev=327&view=rev Author: christianhujer Date: 2008-02-10 08:57:09 -0800 (Sun, 10 Feb 2008) Log Message: ----------- Made Utility class final instead of abstract - that's more consistent with the original Java API. Modified Paths: -------------- trunk/src/java/src/prj/net/sf/aceunit/SourceFiles.java Modified: trunk/src/java/src/prj/net/sf/aceunit/SourceFiles.java =================================================================== --- trunk/src/java/src/prj/net/sf/aceunit/SourceFiles.java 2008-02-10 16:53:53 UTC (rev 326) +++ trunk/src/java/src/prj/net/sf/aceunit/SourceFiles.java 2008-02-10 16:57:09 UTC (rev 327) @@ -41,7 +41,7 @@ /** Utility class with methods for reading source files. * @author <a href="mailto:ch...@ri...">Christian Hujer</a> */ -public abstract class SourceFiles { +public final class SourceFiles { /** FileFilter to get directories. */ public static final FileFilter DIR_FILTER = new FileFilter() { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <chr...@us...> - 2008-02-10 16:53:49
|
Revision: 326 http://aceunit.svn.sourceforge.net/aceunit/?rev=326&view=rev Author: christianhujer Date: 2008-02-10 08:53:53 -0800 (Sun, 10 Feb 2008) Log Message: ----------- [ 1887942 ] Java Generator does not detect wrongly formatted test source Modified Paths: -------------- trunk/src/java/src/prj/net/sf/aceunit/MethodList.java Modified: trunk/src/java/src/prj/net/sf/aceunit/MethodList.java =================================================================== --- trunk/src/java/src/prj/net/sf/aceunit/MethodList.java 2008-02-10 16:53:04 UTC (rev 325) +++ trunk/src/java/src/prj/net/sf/aceunit/MethodList.java 2008-02-10 16:53:53 UTC (rev 326) @@ -69,7 +69,7 @@ */ public MethodList(@NotNull final String annotation, @NotNull final String symName, @NotNull final String title) { this.annotation = annotation; - this.pattern = Pattern.compile("\\b" + annotation + "\\b.*?(\\b\\S+?\\b)\\("); + this.pattern = Pattern.compile("\\b" + annotation + "\\b.*?(\\b\\S+?\\b)\\s*?\\(", Pattern.MULTILINE | Pattern.DOTALL); this.symName = symName; this.title = title; } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <chr...@us...> - 2008-02-10 16:53:12
|
Revision: 325 http://aceunit.svn.sourceforge.net/aceunit/?rev=325&view=rev Author: christianhujer Date: 2008-02-10 08:53:04 -0800 (Sun, 10 Feb 2008) Log Message: ----------- [ 1887942 ] Java Generator does not detect wrongly formatted test source Modified Paths: -------------- trunk/src/native/test/basic/AceUnitTest.c Modified: trunk/src/native/test/basic/AceUnitTest.c =================================================================== --- trunk/src/native/test/basic/AceUnitTest.c 2008-02-10 16:38:46 UTC (rev 324) +++ trunk/src/native/test/basic/AceUnitTest.c 2008-02-10 16:53:04 UTC (rev 325) @@ -39,6 +39,17 @@ #include "AceUnitData.h" #include "AceUnitTest.h" +/** The number of test cases contained in this fixture. + * This is used to verify that the number of executed test cases is correct. + */ +#define TEST_CASES_FOR_VERIFICATION 12 + +/** The number of test cases that were executed. + * This looks redundant with runnerData->testCaseCount but actually it is not. + * It might be the case that the runner mistakenly executes the wrong methods, e.g. when the generator finds the wrong methods. + */ +static int myTestCaseCount = 0; + /** Clears the current recent error. */ void clearRecentError() { if (runnerData->recentError != NULL) { @@ -53,6 +64,8 @@ assertTrue("assertTrue(msg, true) MUST continue the test case.", true); assertionContinued = true; } + + myTestCaseCount++; helper(); clearRecentError(); if (!assertionContinued) { @@ -67,6 +80,8 @@ assertTrue("Test assertion, expected to fail.", false); assertionContinued = true; } + + myTestCaseCount++; helper(); clearRecentError(); if (assertionContinued) { @@ -76,6 +91,7 @@ /** Tests that {@link #assertTrue()} with a true condition does not set recentError. */ A_Test void testAssertTrueWithTrueNoRecentError() { + myTestCaseCount++; clearRecentError(); assertTrue("assertTrue(msg, true) MUST NOT set recentError.", true); if (runnerData->recentError != NULL) { @@ -87,10 +103,12 @@ /** Tests that {@link #assertTrue()} with a false condition sets recentError. */ A_Test void testAssertTrueWithFalseSetsRecentError() { bool recentErrorSet = false; - clearRecentError(); void helper() { assertTrue("Test assertion, expected to fail.", false); } + + myTestCaseCount++; + clearRecentError(); helper(); if (runnerData->recentError != NULL) { recentErrorSet = true; @@ -108,6 +126,8 @@ assertFalse("assertFalse(msg, false) MUST continue the test case.", false); assertionContinued = true; } + + myTestCaseCount++; helper(); clearRecentError(); if (!assertionContinued) { @@ -122,6 +142,8 @@ assertFalse("Test assertion, expected to fail.", true); assertionContinued = true; } + + myTestCaseCount++; helper(); clearRecentError(); if (assertionContinued) { @@ -131,6 +153,7 @@ /** Tests that {@link #assertFalse()} with a true condition does not set recentError. */ A_Test void testAssertFalseWithFalseNoRecentError() { + myTestCaseCount++; clearRecentError(); assertFalse("assertFalse(msg, false) MUST NOT set recentError.", false); if (runnerData->recentError != NULL) { @@ -142,10 +165,12 @@ /** Tests that {@link #assertFalse()} with a false condition sets recentError. */ A_Test void testAssertFalseWithTrueSetsRecentError() { bool recentErrorSet = false; - clearRecentError(); void helper() { assertFalse("Test assertion, expected to fail.", true); } + + myTestCaseCount++; + clearRecentError(); helper(); if (runnerData->recentError != NULL) { recentErrorSet = true; @@ -165,6 +190,8 @@ assertEquals("assertEquals(msg, val, val) MUST continue the test case.", val1, val2); assertionContinued = true; } + + myTestCaseCount++; helper(); clearRecentError(); if (!assertionContinued) { @@ -181,6 +208,8 @@ assertEquals("assertEquals(msg, val1, val2) MUST NOT continue the test case.", val1, val2); assertionContinued = true; } + + myTestCaseCount++; helper(); clearRecentError(); if (assertionContinued) { @@ -192,6 +221,8 @@ A_Test void testAssertEqualsWithEqualNoRecentError() { int val1 = 10; int val2 = val1; + + myTestCaseCount++; clearRecentError(); assertEquals("assertEquals(msg, val1, val2) MUST NOT set recentError.", val1, val2); if (runnerData->recentError != NULL) { @@ -200,15 +231,24 @@ } } -/** Tests that {@link #assertEquals()} with unequal values sets recentError. */ -A_Test void testAssertEqualsWithUnequalSetsRecentError() { +/** Tests that {@link #assertEquals()} with unequal values sets recentError. + * The strange formatting is intentional for <a href="https://sourceforge.net/tracker/index.php?func=detail&aid=1887942&group_id=207094&atid=1000227">[ 1887942 ] Java Generator does not detect wrongly formatted test source</a> + */ +A_Test +void +testAssertEqualsWithUnequalSetsRecentError + + +() { bool recentErrorSet = false; int val1 = 10; int val2 = 20; - clearRecentError(); void helper() { assertEquals("Test assertion, expected to fail.", val1, val2); } + + myTestCaseCount++; + clearRecentError(); helper(); if (runnerData->recentError != NULL) { recentErrorSet = true; @@ -228,10 +268,19 @@ * @return Exit status (currently always 0). */ int main(int argc, char *argv[]) { + int retVal = 0; runFixture(&AceUnitTestFixture); if (runnerData->testCaseFailureCount != 0) { fprintf(stderr, "Test Cases: %d Errors: %d\n", runnerData->testCaseCount, runnerData->testCaseFailureCount); - return 1; + retVal = 1; } - return 0; + if (runnerData->testCaseCount != TEST_CASES_FOR_VERIFICATION) { + fprintf(stderr, "Test Cases: %d but expected %d\n", runnerData->testCaseCount, TEST_CASES_FOR_VERIFICATION); + retVal = 1; + } + if (myTestCaseCount != TEST_CASES_FOR_VERIFICATION) { + fprintf(stderr, "Test Cases really executed: %d but expected %d\n", myTestCaseCount, TEST_CASES_FOR_VERIFICATION); + retVal = 1; + } + return retVal; } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <chr...@us...> - 2008-02-10 16:38:44
|
Revision: 324 http://aceunit.svn.sourceforge.net/aceunit/?rev=324&view=rev Author: christianhujer Date: 2008-02-10 08:38:46 -0800 (Sun, 10 Feb 2008) Log Message: ----------- [ 1887942 ] Java Generator does not detect wrongly formatted test source Modified Paths: -------------- trunk/src/java/src/prj/net/sf/aceunit/MethodList.java Modified: trunk/src/java/src/prj/net/sf/aceunit/MethodList.java =================================================================== --- trunk/src/java/src/prj/net/sf/aceunit/MethodList.java 2008-02-03 20:55:31 UTC (rev 323) +++ trunk/src/java/src/prj/net/sf/aceunit/MethodList.java 2008-02-10 16:38:46 UTC (rev 324) @@ -69,7 +69,7 @@ */ public MethodList(@NotNull final String annotation, @NotNull final String symName, @NotNull final String title) { this.annotation = annotation; - this.pattern = Pattern.compile(annotation + "\\s+[^(]+?\\s+([^ (]+)\\("); + this.pattern = Pattern.compile("\\b" + annotation + "\\b.*?(\\b\\S+?\\b)\\("); this.symName = symName; this.title = title; } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <chr...@us...> - 2008-02-03 20:55:32
|
Revision: 323 http://aceunit.svn.sourceforge.net/aceunit/?rev=323&view=rev Author: christianhujer Date: 2008-02-03 12:55:31 -0800 (Sun, 03 Feb 2008) Log Message: ----------- [ 1885175 ] SetJmp include should become parameter Modified Paths: -------------- trunk/src/native/AceUnit.h Modified: trunk/src/native/AceUnit.h =================================================================== --- trunk/src/native/AceUnit.h 2008-02-02 17:58:00 UTC (rev 322) +++ trunk/src/native/AceUnit.h 2008-02-03 20:55:31 UTC (rev 323) @@ -146,11 +146,20 @@ * The macro should expand to valid fields in a structure. * These fields will be inserted at the end of #AceUnitRunnerData_t. * </dd> - * <dt<<code>ACEUNIT_CONFIG_FILE</code></dt> + * <dt><code>ACEUNIT_CONFIG_FILE</code></dt> * <dd> * If you want to configure AceUnit more comfortably than with defines passed via make to your compiler, you can define this macro. * The macro then must evaluate to a valid include file. * </dd> + * <dt><code>ACEUNIT_SETJMP_INCLUDE</code></dt> + * <dd> + * If you want AceUnit to use setjmp / longjmp but want it to include a different file than <code><setjmp.h></code>, define this macro. + * The macro then must evaluate to a valid include file. + * </dd> + * <dt><code>ACEUNIT_SKIP_SETJMP_INCLUDE</code></dt> + * <dd> + * If you want AceUnit to use setjmp / longjmp but do not want AceUnit to automatically include any file for it, define this macro. + * </dd> * </dl> * @author <a href="mailto:ch...@ri...">Christian Hujer</a> * @file AceUnit.h @@ -272,7 +281,12 @@ #elif ACEUNIT_ASSERTION_STYLE == ACEUNIT_ASSERTION_STYLE_ABORT #include <stdlib.h> #elif ACEUNIT_ASSERTION_STYLE == ACEUNIT_ASSERTION_STYLE_LONGJMP + #ifdef ACEUNIT_SETJMP_INCLUDE + #include ACEUNIT_SETJMP_INCLUDE + #elif ACEUNIT_SKIP_SETJMP_INCLUDE + #else #include <setjmp.h> + #endif /** Jump Buffer for AceUnit to abort a test case and jump back to the runner. */ extern jmp_buf aceunitJmpBuf; #elif ACEUNIT_ASSERTION_STYLE == ACEUNIT_ASSERTION_STYLE_CUSTOM This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <chr...@us...> - 2008-02-02 17:58:01
|
Revision: 322 http://aceunit.svn.sourceforge.net/aceunit/?rev=322&view=rev Author: christianhujer Date: 2008-02-02 09:58:00 -0800 (Sat, 02 Feb 2008) Log Message: ----------- [ 1885173 ] optional configuration header file Modified Paths: -------------- trunk/src/native/AceUnit.h Modified: trunk/src/native/AceUnit.h =================================================================== --- trunk/src/native/AceUnit.h 2008-01-27 20:48:42 UTC (rev 321) +++ trunk/src/native/AceUnit.h 2008-02-02 17:58:00 UTC (rev 322) @@ -146,10 +146,20 @@ * The macro should expand to valid fields in a structure. * These fields will be inserted at the end of #AceUnitRunnerData_t. * </dd> + * <dt<<code>ACEUNIT_CONFIG_FILE</code></dt> + * <dd> + * If you want to configure AceUnit more comfortably than with defines passed via make to your compiler, you can define this macro. + * The macro then must evaluate to a valid include file. + * </dd> * </dl> * @author <a href="mailto:ch...@ri...">Christian Hujer</a> * @file AceUnit.h */ + +#ifdef ACEUNIT_CONFIG_FILE +#include ACEUNIT_CONFIG_FILE +#endif + #if defined(__STDC_VERSION__) && (__STDC_VERSION__ >= 19901L) && defined(ACEUNIT_C99) #include <stddef.h> #include <stdint.h> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <chr...@us...> - 2008-01-27 20:48:39
|
Revision: 321 http://aceunit.svn.sourceforge.net/aceunit/?rev=321&view=rev Author: christianhujer Date: 2008-01-27 12:48:42 -0800 (Sun, 27 Jan 2008) Log Message: ----------- Improved code quality. Modified Paths: -------------- trunk/src/java/src/prj/net/sf/aceunit/CommentToWhitespaceReader.java Modified: trunk/src/java/src/prj/net/sf/aceunit/CommentToWhitespaceReader.java =================================================================== --- trunk/src/java/src/prj/net/sf/aceunit/CommentToWhitespaceReader.java 2008-01-27 20:46:06 UTC (rev 320) +++ trunk/src/java/src/prj/net/sf/aceunit/CommentToWhitespaceReader.java 2008-01-27 20:48:42 UTC (rev 321) @@ -39,7 +39,7 @@ public class CommentToWhitespaceReader extends FilterReader { /** The internal states of the parser. */ - enum State { + private enum State { /** Nothing special, normal source. */ NORMAL, @@ -72,14 +72,16 @@ ESCAPE_IN_STRING } // enum State + /** The Sync Lock. */ + @NotNull private final Object syncLock = new Object(); + /** The internal parser state, we begin with State.NORMAL. */ - private State state = State.NORMAL; + @NotNull private State state = State.NORMAL; /** The cached character is used to return a char that can only be returned when its following char was konwn. * If this is <code>null</code>, there is no cached character. */ - @Nullable - private Integer cachedChar; + @Nullable private Integer cachedChar; /** Creates a new NoCommentReader. * @@ -92,7 +94,7 @@ /** {@inheritDoc} */ public int read() throws IOException { - synchronized (this) { + synchronized (syncLock) { final Integer cachedChar = this.cachedChar; if (cachedChar != null) { try { @@ -117,7 +119,7 @@ * @throws IOException In caes of I/O problems. */ private int readImpl() throws IOException { - int c = super.read(); + final int c = super.read(); int rc; switch (state) { case NORMAL: @@ -241,7 +243,7 @@ } /** {@inheritDoc} */ - public int read(final char[] cbuf, final int off, final int len) throws IOException { + public int read(@NotNull final char[] cbuf, final int off, final int len) throws IOException { int i; for (i = 0; i < len; i++) { int c = read(); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <chr...@us...> - 2008-01-27 20:46:07
|
Revision: 320 http://aceunit.svn.sourceforge.net/aceunit/?rev=320&view=rev Author: christianhujer Date: 2008-01-27 12:46:06 -0800 (Sun, 27 Jan 2008) Log Message: ----------- Performance improvement when reading files. Modified Paths: -------------- trunk/src/java/src/prj/net/sf/aceunit/SourceFiles.java Modified: trunk/src/java/src/prj/net/sf/aceunit/SourceFiles.java =================================================================== --- trunk/src/java/src/prj/net/sf/aceunit/SourceFiles.java 2008-01-27 19:04:15 UTC (rev 319) +++ trunk/src/java/src/prj/net/sf/aceunit/SourceFiles.java 2008-01-27 20:46:06 UTC (rev 320) @@ -35,6 +35,7 @@ import java.io.PrintWriter; import java.io.FileWriter; import java.io.FileFilter; +import java.io.BufferedReader; import static java.util.logging.Logger.getAnonymousLogger; /** Utility class with methods for reading source files. @@ -83,7 +84,7 @@ * @throws java.io.IOException in case of I/O problems. */ public static String readSourceWithoutComments(@NotNull final File file) throws IOException { - final Reader in = new CommentToWhitespaceReader(new FileReader(file)); + final Reader in = new CommentToWhitespaceReader(new BufferedReader(new FileReader(file))); final StringBuilder sb = new StringBuilder(); final char[] buf = new char[4096]; for (int charsRead; (charsRead = in.read(buf)) != -1;) { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <chr...@us...> - 2008-01-27 19:04:20
|
Revision: 319 http://aceunit.svn.sourceforge.net/aceunit/?rev=319&view=rev Author: christianhujer Date: 2008-01-27 11:04:15 -0800 (Sun, 27 Jan 2008) Log Message: ----------- Added package documentation. Added Paths: ----------- trunk/src/java/src/prj/net/sf/aceunit/package-info.java trunk/src/java/src/tst/test/net/sf/aceunit/package-info.java Added: trunk/src/java/src/prj/net/sf/aceunit/package-info.java =================================================================== --- trunk/src/java/src/prj/net/sf/aceunit/package-info.java (rev 0) +++ trunk/src/java/src/prj/net/sf/aceunit/package-info.java 2008-01-27 19:04:15 UTC (rev 319) @@ -0,0 +1,33 @@ +/* Copyright (c) 2008, 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. + */ + +/** This is the Java Generator of AceUnit. + * The Java Generator scans suites (c sources with fixtures and directories containing them) and generates the required header files. + * For more information, see {@link GenTest}. + * @author <a href="mailto:ch...@ri...">Christian Hujer</a> + */ +package net.sf.aceunit; Property changes on: trunk/src/java/src/prj/net/sf/aceunit/package-info.java ___________________________________________________________________ Name: svn:mime-type + text/plain Name: svn:eol-style + LF Added: trunk/src/java/src/tst/test/net/sf/aceunit/package-info.java =================================================================== --- trunk/src/java/src/tst/test/net/sf/aceunit/package-info.java (rev 0) +++ trunk/src/java/src/tst/test/net/sf/aceunit/package-info.java 2008-01-27 19:04:15 UTC (rev 319) @@ -0,0 +1,31 @@ +/* Copyright (c) 2008, 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. + */ + +/** Unit tests for package {@link net.sf.aceunit}. + * @author <a href="mailto:ch...@ri...">Christian Hujer</a> + */ +package test.net.sf.aceunit; Property changes on: trunk/src/java/src/tst/test/net/sf/aceunit/package-info.java ___________________________________________________________________ Name: svn:mime-type + text/plain 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...> - 2008-01-26 23:50:12
|
Revision: 318 http://aceunit.svn.sourceforge.net/aceunit/?rev=318&view=rev Author: christianhujer Date: 2008-01-26 15:50:17 -0800 (Sat, 26 Jan 2008) Log Message: ----------- Updated release info on homepage. Modified Paths: -------------- trunk/src/doc/start.xhtml Modified: trunk/src/doc/start.xhtml =================================================================== --- trunk/src/doc/start.xhtml 2008-01-26 23:47:26 UTC (rev 317) +++ trunk/src/doc/start.xhtml 2008-01-26 23:50:17 UTC (rev 318) @@ -20,7 +20,7 @@ </div> --> <p> - Latest release version: <strong>aceunit-0.6</strong> + Latest release version: <strong>aceunit-0.6.1</strong> </p> <h2>What is AceUnit?</h2> <!-- The description must match the project description at http://sourceforge.net/projects/aceunit/ --> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <chr...@us...> - 2008-01-26 23:47:25
|
Revision: 317 http://aceunit.svn.sourceforge.net/aceunit/?rev=317&view=rev Author: christianhujer Date: 2008-01-26 15:47:26 -0800 (Sat, 26 Jan 2008) Log Message: ----------- [ 1880486 ] --force may log info when removing write protection Modified Paths: -------------- trunk/src/java/src/prj/net/sf/aceunit/SourceFiles.java Modified: trunk/src/java/src/prj/net/sf/aceunit/SourceFiles.java =================================================================== --- trunk/src/java/src/prj/net/sf/aceunit/SourceFiles.java 2008-01-26 23:39:17 UTC (rev 316) +++ trunk/src/java/src/prj/net/sf/aceunit/SourceFiles.java 2008-01-26 23:47:26 UTC (rev 317) @@ -35,6 +35,7 @@ import java.io.PrintWriter; import java.io.FileWriter; import java.io.FileFilter; +import static java.util.logging.Logger.getAnonymousLogger; /** Utility class with methods for reading source files. * @author <a href="mailto:ch...@ri...">Christian Hujer</a> @@ -101,7 +102,10 @@ public static void writeIfChanged(@NotNull final File file, @NotNull final String text, final boolean force) throws IOException { if (!file.exists() || !text.equals(readSource(file))) { if (force) { - file.setWritable(true); + if (!file.canWrite()) { + getAnonymousLogger().info("Removing write protection from " + file); + file.setWritable(true); + } } final PrintWriter out = new PrintWriter(new FileWriter(file)); try { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <chr...@us...> - 2008-01-26 23:39:13
|
Revision: 316 http://aceunit.svn.sourceforge.net/aceunit/?rev=316&view=rev Author: christianhujer Date: 2008-01-26 15:39:17 -0800 (Sat, 26 Jan 2008) Log Message: ----------- [ 1880495 ] usage of --force throws NoConverterFoundException Modified Paths: -------------- trunk/src/java/src/prj/net/sf/aceunit/GenTest.java Modified: trunk/src/java/src/prj/net/sf/aceunit/GenTest.java =================================================================== --- trunk/src/java/src/prj/net/sf/aceunit/GenTest.java 2008-01-26 22:45:01 UTC (rev 315) +++ trunk/src/java/src/prj/net/sf/aceunit/GenTest.java 2008-01-26 23:39:17 UTC (rev 316) @@ -69,7 +69,7 @@ * @param force Whether overwriting of existing files should be enforced. */ @Option({"f", "force"}) - public void setForce(final boolean force) { + public void setForce(@NotNull final Boolean force) { this.force = force; } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <chr...@us...> - 2008-01-26 22:44:57
|
Revision: 315 http://aceunit.svn.sourceforge.net/aceunit/?rev=315&view=rev Author: christianhujer Date: 2008-01-26 14:45:01 -0800 (Sat, 26 Jan 2008) Log Message: ----------- Creating release tag 0.6.1 for branch 0.6. Added Paths: ----------- tags/0.6.1/ Copied: tags/0.6.1 (from rev 314, branches/0.6) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <chr...@us...> - 2008-01-26 22:31:33
|
Revision: 314 http://aceunit.svn.sourceforge.net/aceunit/?rev=314&view=rev Author: christianhujer Date: 2008-01-26 14:31:29 -0800 (Sat, 26 Jan 2008) Log Message: ----------- Creating release tag 0.5.2 for branch 0.5. Added Paths: ----------- tags/0.5.2/ Copied: tags/0.5.2 (from rev 313, branches/0.5) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <chr...@us...> - 2008-01-26 14:20:26
|
Revision: 313 http://aceunit.svn.sourceforge.net/aceunit/?rev=313&view=rev Author: christianhujer Date: 2008-01-26 06:20:25 -0800 (Sat, 26 Jan 2008) Log Message: ----------- Fix for [ 1879533 ] missing EOL at EOF makes Generator run out of heap space Modified Paths: -------------- trunk/src/java/src/prj/net/sf/aceunit/CommentToWhitespaceReader.java trunk/src/java/src/tst/test/net/sf/aceunit/CommentToWhitespaceReaderTest.java Modified: trunk/src/java/src/prj/net/sf/aceunit/CommentToWhitespaceReader.java =================================================================== --- trunk/src/java/src/prj/net/sf/aceunit/CommentToWhitespaceReader.java 2008-01-26 14:12:07 UTC (rev 312) +++ trunk/src/java/src/prj/net/sf/aceunit/CommentToWhitespaceReader.java 2008-01-26 14:20:25 UTC (rev 313) @@ -162,7 +162,7 @@ rc = c; } else { state = State.EOL_COMMENT; - rc = ' '; + rc = c == -1 ? c : ' '; } break; case ML_COMMENT: @@ -177,7 +177,7 @@ rc = ' '; } else { state = State.ML_COMMENT; - rc = ' '; + rc = c == -1 ? c : ' '; } break; case MAYBE_END_OF_ML_COMMENT: Modified: trunk/src/java/src/tst/test/net/sf/aceunit/CommentToWhitespaceReaderTest.java =================================================================== --- trunk/src/java/src/tst/test/net/sf/aceunit/CommentToWhitespaceReaderTest.java 2008-01-26 14:12:07 UTC (rev 312) +++ trunk/src/java/src/tst/test/net/sf/aceunit/CommentToWhitespaceReaderTest.java 2008-01-26 14:20:25 UTC (rev 313) @@ -114,7 +114,7 @@ assertReplacement(orig, expe); } - /** Test that consecutive single line comments at the start of the text are replaced by whitespace. + /** Tests that consecutive single line comments at the start of the text are replaced by whitespace. * @throws IOException In case of I/O problems (unexpected). */ @Test public void multilineCommentAtStart() throws IOException { @@ -123,6 +123,69 @@ assertReplacement(orig, expe); } + /** Tests that an incomplete last line works. + * @throws IOException In case of I/O problems (unexpected). + */ + @Test public void incompleteLastLine() throws IOException { + final String orig = "void foo() { }"; + final String expe = "void foo() { }"; + assertReplacement(orig, expe); + } + + /** Tests that an incomplete last line with multiline comment works. + * @throws IOException In case of I/O problems (unexpected). + */ + @Test public void incompleteLastLineWithMultilineComment() throws IOException { + final String orig = "/* foo */"; + final String expe = " "; + assertReplacement(orig, expe); + } + + /** Tests that an incomplete last line with EOL comment works. + * @throws IOException In case of I/O problems (unexpected). + */ + @Test public void incompleteLastLineWithEOLComment() throws IOException { + final String orig = "// foo"; + final String expe = " "; + assertReplacement(orig, expe); + } + + /** Tests that an incomplete multiline comment works. + * @throws IOException In case of I/O problems (unexpected). + */ + @Test public void incompleteMultilineComment() throws IOException { + final String orig = "/* "; + final String expe = " "; + assertReplacement(orig, expe); + } + + /** Tests that an incomplete multiline comment works. + * @throws IOException In case of I/O problems (unexpected). + */ + @Test public void incompleteString() throws IOException { + final String orig = "\"xxx"; + final String expe = "\"xxx"; + assertReplacement(orig, expe); + } + + /** Tests that an incomplete multiline comment works. + * @throws IOException In case of I/O problems (unexpected). + */ + @Test public void incompleteChar() throws IOException { + final String orig = "'x"; + final String expe = "'x"; + assertReplacement(orig, expe); + } + + /** Tests that an incomplete multiline comment works. + * @throws IOException In case of I/O problems (unexpected). + */ + @Test public void incompleteEscape() throws IOException { + final String orig = "\\"; + final String expe = "\\"; + assertReplacement(orig, expe); + } + /** Asserts that when reading the String <var>orig</var> through a {@link CommentToWhitespaceReader}, <var>expe</var> is returned. * @param orig Original String, will be passed through a {@link CommentToWhitespaceReader}. * @param expe Expected String, will be compared to the result of passing <var>orig</var> through a {@link CommentToWhitespaceReader}. This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <chr...@us...> - 2008-01-26 14:13:26
|
Revision: 312 http://aceunit.svn.sourceforge.net/aceunit/?rev=312&view=rev Author: christianhujer Date: 2008-01-26 06:12:07 -0800 (Sat, 26 Jan 2008) Log Message: ----------- Fix for [ 1879533 ] missing EOL at EOF makes Generator run out of heap space Modified Paths: -------------- branches/0.6/src/java/src/prj/net/sf/aceunit/CommentToWhitespaceReader.java branches/0.6/src/java/src/tst/test/net/sf/aceunit/CommentToWhitespaceReaderTest.java Modified: branches/0.6/src/java/src/prj/net/sf/aceunit/CommentToWhitespaceReader.java =================================================================== --- branches/0.6/src/java/src/prj/net/sf/aceunit/CommentToWhitespaceReader.java 2008-01-26 14:04:26 UTC (rev 311) +++ branches/0.6/src/java/src/prj/net/sf/aceunit/CommentToWhitespaceReader.java 2008-01-26 14:12:07 UTC (rev 312) @@ -162,7 +162,7 @@ rc = c; } else { state = State.EOL_COMMENT; - rc = ' '; + rc = c == -1 ? c : ' '; } break; case ML_COMMENT: @@ -177,7 +177,7 @@ rc = ' '; } else { state = State.ML_COMMENT; - rc = ' '; + rc = c == -1 ? c : ' '; } break; case MAYBE_END_OF_ML_COMMENT: Modified: branches/0.6/src/java/src/tst/test/net/sf/aceunit/CommentToWhitespaceReaderTest.java =================================================================== --- branches/0.6/src/java/src/tst/test/net/sf/aceunit/CommentToWhitespaceReaderTest.java 2008-01-26 14:04:26 UTC (rev 311) +++ branches/0.6/src/java/src/tst/test/net/sf/aceunit/CommentToWhitespaceReaderTest.java 2008-01-26 14:12:07 UTC (rev 312) @@ -114,7 +114,7 @@ assertReplacement(orig, expe); } - /** Test that consecutive single line comments at the start of the text are replaced by whitespace. + /** Tests that consecutive single line comments at the start of the text are replaced by whitespace. * @throws IOException In case of I/O problems (unexpected). */ @Test public void multilineCommentAtStart() throws IOException { @@ -123,6 +123,69 @@ assertReplacement(orig, expe); } + /** Tests that an incomplete last line works. + * @throws IOException In case of I/O problems (unexpected). + */ + @Test public void incompleteLastLine() throws IOException { + final String orig = "void foo() { }"; + final String expe = "void foo() { }"; + assertReplacement(orig, expe); + } + + /** Tests that an incomplete last line with multiline comment works. + * @throws IOException In case of I/O problems (unexpected). + */ + @Test public void incompleteLastLineWithMultilineComment() throws IOException { + final String orig = "/* foo */"; + final String expe = " "; + assertReplacement(orig, expe); + } + + /** Tests that an incomplete last line with EOL comment works. + * @throws IOException In case of I/O problems (unexpected). + */ + @Test public void incompleteLastLineWithEOLComment() throws IOException { + final String orig = "// foo"; + final String expe = " "; + assertReplacement(orig, expe); + } + + /** Tests that an incomplete multiline comment works. + * @throws IOException In case of I/O problems (unexpected). + */ + @Test public void incompleteMultilineComment() throws IOException { + final String orig = "/* "; + final String expe = " "; + assertReplacement(orig, expe); + } + + /** Tests that an incomplete multiline comment works. + * @throws IOException In case of I/O problems (unexpected). + */ + @Test public void incompleteString() throws IOException { + final String orig = "\"xxx"; + final String expe = "\"xxx"; + assertReplacement(orig, expe); + } + + /** Tests that an incomplete multiline comment works. + * @throws IOException In case of I/O problems (unexpected). + */ + @Test public void incompleteChar() throws IOException { + final String orig = "'x"; + final String expe = "'x"; + assertReplacement(orig, expe); + } + + /** Tests that an incomplete multiline comment works. + * @throws IOException In case of I/O problems (unexpected). + */ + @Test public void incompleteEscape() throws IOException { + final String orig = "\\"; + final String expe = "\\"; + assertReplacement(orig, expe); + } + /** Asserts that when reading the String <var>orig</var> through a {@link CommentToWhitespaceReader}, <var>expe</var> is returned. * @param orig Original String, will be passed through a {@link CommentToWhitespaceReader}. * @param expe Expected String, will be compared to the result of passing <var>orig</var> through a {@link CommentToWhitespaceReader}. This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <chr...@us...> - 2008-01-26 14:09:28
|
Revision: 311 http://aceunit.svn.sourceforge.net/aceunit/?rev=311&view=rev Author: christianhujer Date: 2008-01-26 06:04:26 -0800 (Sat, 26 Jan 2008) Log Message: ----------- Fix for [ 1879533 ] missing EOL at EOF makes Generator run out of heap space Modified Paths: -------------- branches/0.5/src/java/src/prj/net/sf/aceunit/CommentToWhitespaceReader.java branches/0.5/src/java/src/tst/test/net/sf/aceunit/CommentToWhitespaceReaderTest.java Modified: branches/0.5/src/java/src/prj/net/sf/aceunit/CommentToWhitespaceReader.java =================================================================== --- branches/0.5/src/java/src/prj/net/sf/aceunit/CommentToWhitespaceReader.java 2008-01-17 22:38:37 UTC (rev 310) +++ branches/0.5/src/java/src/prj/net/sf/aceunit/CommentToWhitespaceReader.java 2008-01-26 14:04:26 UTC (rev 311) @@ -162,7 +162,7 @@ rc = c; } else { state = State.EOL_COMMENT; - rc = ' '; + rc = c == -1 ? c : ' '; } break; case ML_COMMENT: @@ -177,7 +177,7 @@ rc = ' '; } else { state = State.ML_COMMENT; - rc = ' '; + rc = c == -1 ? c : ' '; } break; case MAYBE_END_OF_ML_COMMENT: Modified: branches/0.5/src/java/src/tst/test/net/sf/aceunit/CommentToWhitespaceReaderTest.java =================================================================== --- branches/0.5/src/java/src/tst/test/net/sf/aceunit/CommentToWhitespaceReaderTest.java 2008-01-17 22:38:37 UTC (rev 310) +++ branches/0.5/src/java/src/tst/test/net/sf/aceunit/CommentToWhitespaceReaderTest.java 2008-01-26 14:04:26 UTC (rev 311) @@ -114,7 +114,7 @@ assertReplacement(orig, expe); } - /** Test that consecutive single line comments at the start of the text are replaced by whitespace. + /** Tests that consecutive single line comments at the start of the text are replaced by whitespace. * @throws IOException In case of I/O problems (unexpected). */ @Test public void multilineCommentAtStart() throws IOException { @@ -123,6 +123,69 @@ assertReplacement(orig, expe); } + /** Tests that an incomplete last line works. + * @throws IOException In case of I/O problems (unexpected). + */ + @Test public void incompleteLastLine() throws IOException { + final String orig = "void foo() { }"; + final String expe = "void foo() { }"; + assertReplacement(orig, expe); + } + + /** Tests that an incomplete last line with multiline comment works. + * @throws IOException In case of I/O problems (unexpected). + */ + @Test public void incompleteLastLineWithMultilineComment() throws IOException { + final String orig = "/* foo */"; + final String expe = " "; + assertReplacement(orig, expe); + } + + /** Tests that an incomplete last line with EOL comment works. + * @throws IOException In case of I/O problems (unexpected). + */ + @Test public void incompleteLastLineWithEOLComment() throws IOException { + final String orig = "// foo"; + final String expe = " "; + assertReplacement(orig, expe); + } + + /** Tests that an incomplete multiline comment works. + * @throws IOException In case of I/O problems (unexpected). + */ + @Test public void incompleteMultilineComment() throws IOException { + final String orig = "/* "; + final String expe = " "; + assertReplacement(orig, expe); + } + + /** Tests that an incomplete multiline comment works. + * @throws IOException In case of I/O problems (unexpected). + */ + @Test public void incompleteString() throws IOException { + final String orig = "\"xxx"; + final String expe = "\"xxx"; + assertReplacement(orig, expe); + } + + /** Tests that an incomplete multiline comment works. + * @throws IOException In case of I/O problems (unexpected). + */ + @Test public void incompleteChar() throws IOException { + final String orig = "'x"; + final String expe = "'x"; + assertReplacement(orig, expe); + } + + /** Tests that an incomplete multiline comment works. + * @throws IOException In case of I/O problems (unexpected). + */ + @Test public void incompleteEscape() throws IOException { + final String orig = "\\"; + final String expe = "\\"; + assertReplacement(orig, expe); + } + /** Asserts that when reading the String <var>orig</var> through a {@link CommentToWhitespaceReader}, <var>expe</var> is returned. * @param orig Original String, will be passed through a {@link CommentToWhitespaceReader}. * @param expe Expected String, will be compared to the result of passing <var>orig</var> through a {@link CommentToWhitespaceReader}. This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <chr...@us...> - 2008-01-17 22:41:06
|
Revision: 310 http://aceunit.svn.sourceforge.net/aceunit/?rev=310&view=rev Author: christianhujer Date: 2008-01-17 14:38:37 -0800 (Thu, 17 Jan 2008) Log Message: ----------- Updated release info on homepage. Modified Paths: -------------- trunk/src/doc/start.xhtml Modified: trunk/src/doc/start.xhtml =================================================================== --- trunk/src/doc/start.xhtml 2008-01-17 22:18:54 UTC (rev 309) +++ trunk/src/doc/start.xhtml 2008-01-17 22:38:37 UTC (rev 310) @@ -20,7 +20,7 @@ </div> --> <p> - Latest release version: <strong>aceunit-0.5</strong> + Latest release version: <strong>aceunit-0.6</strong> </p> <h2>What is AceUnit?</h2> <!-- The description must match the project description at http://sourceforge.net/projects/aceunit/ --> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <chr...@us...> - 2008-01-17 22:19:48
|
Revision: 309 http://aceunit.svn.sourceforge.net/aceunit/?rev=309&view=rev Author: christianhujer Date: 2008-01-17 14:18:54 -0800 (Thu, 17 Jan 2008) Log Message: ----------- Creating release tag 0.6 for branch 0.6. Added Paths: ----------- tags/0.6/ Copied: tags/0.6 (from rev 308, branches/0.6) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |