[glom/import_csv_refactored] Removed some debug output.
- From: Murray Cumming <murrayc src gnome org>
- To: svn-commits-list gnome org
- Cc:
- Subject: [glom/import_csv_refactored] Removed some debug output.
- Date: Fri, 25 Sep 2009 13:20:15 +0000 (UTC)
commit 7011de6406d6ba419e32cf6f717cd0cc09e9b5ea
Author: Murray Cumming <murrayc murrayc com>
Date: Fri Sep 25 14:58:26 2009 +0200
Removed some debug output.
* glom/libglom/data_structure/glomconversions.cc: parse_time():
* tests/test_parsing_time.cc: Removed debug output.
ChangeLog | 7 +++++
glom/libglom/data_structure/glomconversions.cc | 2 +-
tests/import/test_parsing.cc | 30 +++++++++++------------
tests/import/test_signals.cc | 14 +++++-----
tests/test_parsing_time.cc | 4 +-
5 files changed, 31 insertions(+), 26 deletions(-)
---
diff --git a/ChangeLog b/ChangeLog
index 30ef067..1112cf5 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2009-09-25 Murray Cumming <murrayc murrayc com>
+
+ Removed some debug output.
+
+ * glom/libglom/data_structure/glomconversions.cc: parse_time():
+ * tests/test_parsing_time.cc: Removed debug output.
+
2009-09-25 Michael Hasselmann <michaelh openismus com>
Import: Changed the signature of line_scanned handler
diff --git a/glom/libglom/data_structure/glomconversions.cc b/glom/libglom/data_structure/glomconversions.cc
index ae70df7..6d017bc 100644
--- a/glom/libglom/data_structure/glomconversions.cc
+++ b/glom/libglom/data_structure/glomconversions.cc
@@ -764,7 +764,7 @@ tm Conversions::parse_time(const Glib::ustring& text, bool& success)
tm Conversions::parse_time(const Glib::ustring& text, const std::locale& locale, bool& success)
{
- std::cout << "parse_time(): text=" << text << std::endl;
+ //std::cout << "parse_time(): text=" << text << std::endl;
//The sequence of statements here seems to be very fragile. If you move things then it stops working.
//return parse_tm(text, locale, 'X' /* time */);
diff --git a/tests/import/test_parsing.cc b/tests/import/test_parsing.cc
index b538232..b6f83b4 100644
--- a/tests/import/test_parsing.cc
+++ b/tests/import/test_parsing.cc
@@ -8,8 +8,6 @@
namespace
{
-void print_tokens();
-
typedef std::vector<std::string> type_tokens;
type_tokens& get_tokens_instance()
@@ -98,9 +96,9 @@ int main(int argc, char* argv[])
// test_dquoted_string
{
const char raw[] = "\"a \"\"quoted\"\" token\",\"sans quotes\"\n";
- bool finished_parsing = ImportTests::run_parser_from_buffer(&connect_signals, raw, sizeof(raw));
+ const bool finished_parsing = ImportTests::run_parser_from_buffer(&connect_signals, raw, sizeof(raw));
- bool passed = (finished_parsing &&
+ const bool passed = (finished_parsing &&
check_tokens("^(a \"quoted\" token|sans quotes)$") &&
2 == get_tokens_instance().size());
get_tokens_instance().clear();
@@ -112,9 +110,9 @@ int main(int argc, char* argv[])
// test_skip_on_no_ending_newline
{
const char raw[] = "\"token in first line\"\n\"2nd token\", \"but\", \"this\",\"line\",\"will\",\"be\",\"skipped\"";
- bool finished_parsing = ImportTests::run_parser_from_buffer(&connect_signals, raw, sizeof(raw));
+ const bool finished_parsing = ImportTests::run_parser_from_buffer(&connect_signals, raw, sizeof(raw));
- bool passed = (finished_parsing &&
+ const bool passed = (finished_parsing &&
check_tokens("token in first line") &&
1 == get_tokens_instance().size());
get_tokens_instance().clear();
@@ -126,9 +124,9 @@ int main(int argc, char* argv[])
// test_skip_on_no_quotes_around_token
{
const char raw[] = "this,line,contains,only,empty,tokens\n";
- bool finished_parsing = ImportTests::run_parser_from_buffer(&connect_signals, raw, sizeof(raw));
+ const bool finished_parsing = ImportTests::run_parser_from_buffer(&connect_signals, raw, sizeof(raw));
- bool passed = (finished_parsing &&
+ const bool passed = (finished_parsing &&
check_tokens("^$") &&
6 == get_tokens_instance().size());
get_tokens_instance().clear();
@@ -140,9 +138,9 @@ int main(int argc, char* argv[])
// test_skip_spaces_around_separators
{
const char raw[] = "\"spaces\" , \"around\", \"separators\"\n";
- bool finished_parsing = ImportTests::run_parser_from_buffer(&connect_signals, raw, sizeof(raw));
+ const bool finished_parsing = ImportTests::run_parser_from_buffer(&connect_signals, raw, sizeof(raw));
- bool passed = (finished_parsing &&
+ const bool passed = (finished_parsing &&
check_tokens("^(spaces|around|separators)$") &&
3 == get_tokens_instance().size());
get_tokens_instance().clear();
@@ -155,9 +153,9 @@ int main(int argc, char* argv[])
// test_fail_on_non_comma_separators
{
const char raw[] = "\"cannot\"\t\"tokenize\"\t\"this\"\n";
- bool finished_parsing = ImportTests::run_parser_from_buffer(&connect_signals, raw, sizeof(raw));
+ const bool finished_parsing = ImportTests::run_parser_from_buffer(&connect_signals, raw, sizeof(raw));
- bool passed = (finished_parsing &&
+ const bool passed = (finished_parsing &&
check_tokens("^cannottokenizethis$") &&
1 == get_tokens_instance().size());
get_tokens_instance().clear();
@@ -169,9 +167,9 @@ int main(int argc, char* argv[])
// test_parse_newline_inside_quotes
{
const char raw[] = "\"cell with\nnewline\"\n\"token on next line\"\n";
- bool finished_parsing = ImportTests::run_parser_from_buffer(&connect_signals, raw, sizeof(raw));
+ const bool finished_parsing = ImportTests::run_parser_from_buffer(&connect_signals, raw, sizeof(raw));
- bool passed = (finished_parsing &&
+ const bool passed = (finished_parsing &&
check_tokens("^(cell with\nnewline|token on next line)$") &&
2 == get_tokens_instance().size());
get_tokens_instance().clear();
@@ -183,9 +181,9 @@ int main(int argc, char* argv[])
// test_fail_on_non_matching_quotes
{
const char raw[] = "\"token\"\nthis quote has no partner\",\"token\"\n";
- bool finished_parsing = ImportTests::run_parser_from_buffer(&connect_signals, raw, sizeof(raw));
+ const bool finished_parsing = ImportTests::run_parser_from_buffer(&connect_signals, raw, sizeof(raw));
- bool passed = (finished_parsing &&
+ const bool passed = (finished_parsing &&
check_tokens("token") &&
1 == get_tokens_instance().size());
get_tokens_instance().clear();
diff --git a/tests/import/test_signals.cc b/tests/import/test_signals.cc
index b269201..d382776 100644
--- a/tests/import/test_signals.cc
+++ b/tests/import/test_signals.cc
@@ -65,9 +65,9 @@ int main(int argc, char* argv[])
{
// 2 CSV lines, first one contains newlines inside quotes
const char raw[] = "\"some\n quoted\r\n newlines\n\", \"token2\"\n\"token3\"\n";
- bool finished_parsing = ImportTests::run_parser_from_buffer(&connect_signals, raw, sizeof(raw));
+ const bool finished_parsing = ImportTests::run_parser_from_buffer(&connect_signals, raw, sizeof(raw));
- bool passed = (finished_parsing &&
+ const bool passed = (finished_parsing &&
2 == get_line_scanned_count_instance() &&
0 == get_encoding_error_count_instance());
@@ -81,9 +81,9 @@ int main(int argc, char* argv[])
{
// 5 CSV lines, but only 2 contain data
const char raw[] = "token1\n\n\n\ntoken2, token3\n";
- bool finished_parsing = ImportTests::run_parser_from_buffer(&connect_signals, raw, sizeof(raw));
+ const bool finished_parsing = ImportTests::run_parser_from_buffer(&connect_signals, raw, sizeof(raw));
- bool passed = (finished_parsing &&
+ const bool passed = (finished_parsing &&
2 == get_line_scanned_count_instance() &&
0 == get_encoding_error_count_instance());
@@ -130,7 +130,7 @@ int main(int argc, char* argv[])
}
- const bool passed = (2 == get_encoding_error_count_instance() &&
+ const const bool passed = (2 == get_encoding_error_count_instance() &&
0 == get_line_scanned_count_instance());
if(!ImportTests::check("test_wrong_encoding", passed, report))
@@ -145,9 +145,9 @@ int main(int argc, char* argv[])
{
// An incomplete Unicode sequence.
const char raw[] = "\0xc0\n";
- bool finished_parsing = ImportTests::run_parser_from_buffer(&connect_signals, raw, sizeof(raw));
+ const bool finished_parsing = ImportTests::run_parser_from_buffer(&connect_signals, raw, sizeof(raw));
- bool passed = (finished_parsing &&
+ const bool passed = (finished_parsing &&
1 == get_encoding_error_count_instance() &&
0 == get_line_scanned_count_instance());
diff --git a/tests/test_parsing_time.cc b/tests/test_parsing_time.cc
index ce4b307..13a3933 100644
--- a/tests/test_parsing_time.cc
+++ b/tests/test_parsing_time.cc
@@ -5,7 +5,7 @@ int main()
Gnome::Gda::init();
const Glib::ustring time_text_input = "01:00 PM";
- std::cout << "time_text_input=" << time_text_input << std::endl;
+ //std::cout << "time_text_input=" << time_text_input << std::endl;
bool success = false;
@@ -48,7 +48,7 @@ int main()
Glom::Conversions::get_text_for_gda_value(Glom::Field::TYPE_TIME, value);
- std::cout << "time_text_parsed=" << time_text_parsed << std::endl;
+ //std::cout << "time_text_parsed=" << time_text_parsed << std::endl;
return EXIT_SUCCESS;
//This extra check would fail if :00 seconds are added to the text:
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]