*** empty log message ***

This commit is contained in:
John Wiegley 2006-09-03 18:40:28 +00:00
parent 4691e7ac8e
commit f261d82df5
3 changed files with 12 additions and 10 deletions

2
acprep
View file

@ -17,7 +17,7 @@ else
fi fi
autoconf autoconf
INCDIRS="-I/sw/include -I/usr/local/include/boost-1_33 -I/usr/include/httpd/xml" INCDIRS="-I/sw/include -I/sw/include/boost -I/usr/include/httpd/xml"
#INCDIRS="$INCDIRS -I/sw/include/libofx" #INCDIRS="$INCDIRS -I/sw/include/libofx"
INCDIRS="$INCDIRS -I/usr/include/python2.3" INCDIRS="$INCDIRS -I/usr/include/python2.3"
INCDIRS="$INCDIRS -Wno-long-double" INCDIRS="$INCDIRS -Wno-long-double"

View file

@ -20,25 +20,27 @@ public:
TS_ASSERT_EQUALS(0, emptyStream.tellg()); TS_ASSERT_EQUALS(0, emptyStream.tellg());
} }
#if defined(HAVE_EXPAT) || defined(HAVE_XMLPARSE)
void testEmptyFileIsNotXMLFile() void testEmptyFileIsNotXMLFile()
{ {
#if defined(HAVE_EXPAT) || defined(HAVE_XMLPARSE)
stringstream emptyStream(stringstream::in); stringstream emptyStream(stringstream::in);
xml_parser_t xmlParser; xml_parser_t xmlParser;
TS_ASSERT(!xmlParser.test(emptyStream)); TS_ASSERT(!xmlParser.test(emptyStream));
TS_ASSERT(emptyStream.good()); TS_ASSERT(emptyStream.good());
TS_ASSERT_EQUALS(0, emptyStream.tellg()); TS_ASSERT_EQUALS(0, emptyStream.tellg());
#endif
} }
void testEmptyFileIsNotGnuCashFile() void testEmptyFileIsNotGnuCashFile()
{ {
#if defined(HAVE_EXPAT) || defined(HAVE_XMLPARSE)
stringstream emptyStream(stringstream::in); stringstream emptyStream(stringstream::in);
gnucash_parser_t gnucashParser; gnucash_parser_t gnucashParser;
TS_ASSERT(!gnucashParser.test(emptyStream)); TS_ASSERT(!gnucashParser.test(emptyStream));
TS_ASSERT(emptyStream.good()); TS_ASSERT(emptyStream.good());
TS_ASSERT_EQUALS(0, emptyStream.tellg()); TS_ASSERT_EQUALS(0, emptyStream.tellg());
}
#endif #endif
}
void testEmptyFileIsNotBinaryFile() void testEmptyFileIsNotBinaryFile()
{ {

View file

@ -35,13 +35,13 @@ void value_t::simplify()
DEBUG_PRINT("amounts.values.simplify", "Reducing balance pair to balance"); DEBUG_PRINT("amounts.values.simplify", "Reducing balance pair to balance");
cast(BALANCE); cast(BALANCE);
} }
if (type == BALANCE && if (type == BALANCE &&
((balance_t *) data)->amounts.size() == 1) { ((balance_t *) data)->amounts.size() == 1) {
DEBUG_PRINT("amounts.values.simplify", "Reducing balance to amount"); DEBUG_PRINT("amounts.values.simplify", "Reducing balance to amount");
cast(AMOUNT); cast(AMOUNT);
} }
if (type == AMOUNT && if (type == AMOUNT &&
! ((amount_t *) data)->commodity()) { ! ((amount_t *) data)->commodity()) {
DEBUG_PRINT("amounts.values.simplify", "Reducing amount to integer"); DEBUG_PRINT("amounts.values.simplify", "Reducing amount to integer");
@ -97,7 +97,7 @@ value_t& value_t::operator+=(const value_t& value)
throw new value_error("Cannot add a boolean to a value"); throw new value_error("Cannot add a boolean to a value");
else if (value.type == DATETIME) else if (value.type == DATETIME)
throw new value_error("Cannot add a date/time to a value"); throw new value_error("Cannot add a date/time to a value");
switch (type) { switch (type) {
case BOOLEAN: case BOOLEAN:
throw new value_error("Cannot add a value to a boolean"); throw new value_error("Cannot add a value to a boolean");
@ -235,7 +235,7 @@ value_t& value_t::operator-=(const value_t& value)
throw new value_error("Cannot subtract a boolean from a value"); throw new value_error("Cannot subtract a boolean from a value");
else if (value.type == DATETIME && type != DATETIME) else if (value.type == DATETIME && type != DATETIME)
throw new value_error("Cannot subtract a date/time from a value"); throw new value_error("Cannot subtract a date/time from a value");
switch (type) { switch (type) {
case BOOLEAN: case BOOLEAN:
throw new value_error("Cannot subtract a value from a boolean"); throw new value_error("Cannot subtract a value from a boolean");
@ -382,7 +382,7 @@ value_t& value_t::operator*=(const value_t& value)
throw new value_error("Cannot multiply a boolean by a value"); throw new value_error("Cannot multiply a boolean by a value");
else if (value.type == DATETIME) else if (value.type == DATETIME)
throw new value_error("Cannot multiply a date/time by a value"); throw new value_error("Cannot multiply a date/time by a value");
if (value.realzero()) { if (value.realzero()) {
*this = 0L; *this = 0L;
return *this; return *this;
@ -491,7 +491,7 @@ value_t& value_t::operator/=(const value_t& value)
throw new value_error("Cannot divide a boolean by a value"); throw new value_error("Cannot divide a boolean by a value");
else if (value.type == DATETIME) else if (value.type == DATETIME)
throw new value_error("Cannot divide a date/time by a value"); throw new value_error("Cannot divide a date/time by a value");
switch (type) { switch (type) {
case BOOLEAN: case BOOLEAN:
throw new value_error("Cannot divide a value by a boolean"); throw new value_error("Cannot divide a value by a boolean");