[glom/import_csv_refactored] Correct the indentation.
- From: Murray Cumming <murrayc src gnome org>
- To: svn-commits-list gnome org
- Cc:
- Subject: [glom/import_csv_refactored] Correct the indentation.
- Date: Fri, 25 Sep 2009 14:14:38 +0000 (UTC)
commit ef5cf25822b7a982eade8e5c4d5a0d2de99e7425
Author: Murray Cumming <murrayc murrayc com>
Date: Fri Sep 25 15:21:22 2009 +0200
Correct the indentation.
tests/import/test_parsing.cc | 4 ++++
tests/import/utils.cc | 33 +++++++++++++++++----------------
2 files changed, 21 insertions(+), 16 deletions(-)
---
diff --git a/tests/import/test_parsing.cc b/tests/import/test_parsing.cc
index 4eeb3d0..30f64ff 100644
--- a/tests/import/test_parsing.cc
+++ b/tests/import/test_parsing.cc
@@ -19,10 +19,14 @@ type_tokens& get_tokens_instance()
void on_line_scanned(const std::vector<Glib::ustring>& row, guint /*line_number*/)
{
+ std::cout << "debug: on_line_scanned(): row.size()=" << row.size() << std::endl;
+
for(std::vector<Glib::ustring>::const_iterator iter = row.begin();
iter != row.end();
++iter)
{
+ std::cout << " debug: on_line_scanned(): item=" << *iter << std::endl;
+
get_tokens_instance().push_back(*iter);
}
}
diff --git a/tests/import/utils.cc b/tests/import/utils.cc
index 0ab410e..341ea9f 100644
--- a/tests/import/utils.cc
+++ b/tests/import/utils.cc
@@ -52,33 +52,34 @@ void on_mainloop_killed_by_watchdog()
typedef sigc::slot<void, Glom::CsvParser&> FuncConnectParserSignals;
+
bool run_parser_from_buffer(const FuncConnectParserSignals& connect_parser_signals, const char* input, guint size)
{
- get_result_instance() = true;
+ get_result_instance() = true;
- get_mainloop_instance().reset();
- get_mainloop_instance() = Glib::MainLoop::create();
+ get_mainloop_instance().reset();
+ get_mainloop_instance() = Glib::MainLoop::create();
- Glom::CsvParser parser("UTF-8");
+ Glom::CsvParser parser("UTF-8");
- parser.signal_finished_parsing().connect(sigc::mem_fun(*get_mainloop_instance().operator->(), &Glib::MainLoop::quit));
+ parser.signal_finished_parsing().connect(sigc::mem_fun(*get_mainloop_instance().operator->(), &Glib::MainLoop::quit));
- // Install a watchdog for the mainloop, no test should need longer than 3
- // seconds. Also, we need to guard against being stuck in the mainloop.
- // Infinitely running tests are useless.
- get_mainloop_instance()->get_context()->signal_timeout().connect_seconds_once(sigc::ptr_fun(&on_mainloop_killed_by_watchdog), 3);
+ // Install a watchdog for the mainloop, no test should need longer than 3
+ // seconds. Also, we need to guard against being stuck in the mainloop.
+ // Infinitely running tests are useless.
+ get_mainloop_instance()->get_context()->signal_timeout().connect_seconds_once(sigc::ptr_fun(&on_mainloop_killed_by_watchdog), 3);
- connect_parser_signals(parser);
+ connect_parser_signals(parser);
- const std::string file_name = create_file_from_buffer(input, size);
- parser.set_file_and_start_parsing(file_name);
+ const std::string file_name = create_file_from_buffer(input, size);
+ parser.set_file_and_start_parsing(file_name);
- get_mainloop_instance()->run();
+ get_mainloop_instance()->run();
- int result = unlink(Glib::filename_from_uri(file_name).c_str());
- g_assert(-1 != result);
+ int result = unlink(Glib::filename_from_uri(file_name).c_str());
+ g_assert(-1 != result);
- return get_result_instance();
+ return get_result_instance();
}
} //namespace ImportTests
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]