From 3f870945dc876c1af5dd7eddb978e3560eabca14 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Ale=C5=A1=20K=C5=99enek?= Date: Fri, 24 Sep 2004 13:50:55 +0000 Subject: [PATCH] mysterious string comparison solved --- org.glite.lb.server/test/test_query_events.cpp | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/org.glite.lb.server/test/test_query_events.cpp b/org.glite.lb.server/test/test_query_events.cpp index d2765d8..e4e6ba8 100644 --- a/org.glite.lb.server/test/test_query_events.cpp +++ b/org.glite.lb.server/test/test_query_events.cpp @@ -78,14 +78,18 @@ int QueryEventsTest::ExecStmt(const char *qry, edg_wll_Stmt *stmt_out) { vector > >::iterator stmt = queries.begin(); - for (; stmt != queries.end() && strcmp(stmt->first.c_str(),qry); stmt++) cout << stmt->first << endl; + for (; stmt != queries.end(); stmt++) { + const char *q = stmt->first.c_str(); + + /* XXX: there some spaces at the end of qry */ + if (!strncmp(q,qry,strlen(q))) break; + } if (stmt == queries.end()) { cerr << "query not found" << endl; CPPUNIT_ASSERT(0); } vector::iterator *rows = new vector::iterator(stmt->second.begin()); - cout << "first: " << stmt->first << endl; *stmt_out = (edg_wll_Stmt) rows; return stmt->second.size()-1; @@ -108,9 +112,8 @@ int edg_wll_FetchRow(edg_wll_Stmt stmt, char **cols) if (**rows == "END") return 0; row = strdup((*rows)->c_str()); - for (p = strtok(row,"\t"); p; p = strtok(NULL,"\t")) { - cout << (cols[i++] = strdup(p)) << endl; - } + for (p = strtok(row,"\t"); p; p = strtok(NULL,"\t")) + cols[i++] = strdup(p); return i; } -- 1.8.2.3