Permalink
Browse files

Fix most of `node-waf lint` errors

  • Loading branch information...
1 parent 1e77901 commit 695e8f2030e49868a36e7572131aab139fc77ced @Sannis committed Aug 16, 2010
Showing with 17 additions and 13 deletions.
  1. +3 −1 src/mysql_bindings_connection.cc
  2. +5 −3 tests/test-async.js
  3. +1 −1 tests/test-class-mysqlconn.js
  4. +8 −8 tests/test-javascript-interface.js
@@ -941,7 +941,9 @@ Handle<Value> MysqlConn::QueryAsync(const Arguments& args) {
}
query_req->query_length = query.length();
- query_req->query = (char *)calloc(query_req->query_length + 1, sizeof(char));
+ query_req->query =
+ reinterpret_cast<char *>(calloc(query_req->query_length + 1,
+ sizeof(char)));
if (snprintf(query_req->query, query_req->query_length + 1, "%s", *query) !=
query_req->query_length) {
View
@@ -22,7 +22,7 @@ exports.async = function (test) {
};
exports.queryAsync = function (test) {
- var conn = mysql_libmysqlclient.createConnection(cfg.host, cfg.user, cfg.password, cfg.database);
+ var conn = mysql_libmysqlclient.createConnection(cfg.host, cfg.user, cfg.password, cfg.database), res;
res = conn.query("DROP TABLE IF EXISTS " + cfg.test_table + ";");
res = conn.query("CREATE TABLE " + cfg.test_table +
@@ -32,9 +32,11 @@ exports.queryAsync = function (test) {
test.expect(2);
conn.queryAsync("SHOW TABLES", function (result) {
- test.ok(result.fieldCount() == 1, "show results field count == 1");
+ test.ok(result.fieldCount() === 1, "show results field count === 1");
var res = result.fetchAll();
- test.ok(res.some(function(r) {return r['Tables_in_' + cfg.database] == cfg.test_table;}), "find the test table in results");
+ test.ok(res.some(function (r) {
+ return r['Tables_in_' + cfg.database] === cfg.test_table;
+ }), "find the test table in results");
conn.close();
test.done();
});
@@ -104,7 +104,7 @@ exports.ConnectError = function (test) {
error_str = conn.connectError();
- if (error_str.match(new RegExp("Access denied for user '(" + cfg.user + "|)'\@'.*' to database \'" + cfg.database_denied + "\'"))) {
+ if (error_str.match(new RegExp("Access denied for user '(" + cfg.user + "|)'@'.*' to database '" + cfg.database_denied + "'"))) {
test.ok(true, "conn.connectError()");
} else {
test.ok(false, "conn.connectError()");
@@ -28,8 +28,8 @@ exports.mysql_libmysqlclient_createConnection_1 = function (test) {
var conn = mysql_libmysqlclient.createConnection(cfg.host);
test.ok(conn, "mysql_libmysqlclient.createConnection(host)");
test.ok(conn.connected(), "mysql_libmysqlclient.createConnection(host).connected()");
- if(!conn.connected()) {
- sys.puts("Error:" + conn.connectError());
+ if (!conn.connected()) {
+ sys.puts("Error:" + conn.connectError());
}
conn.close();
@@ -42,8 +42,8 @@ exports.mysql_libmysqlclient_createConnection_2 = function (test) {
var conn = mysql_libmysqlclient.createConnection(cfg.host, cfg.user);
test.ok(conn, "mysql_libmysqlclient.createConnection(host, user)");
test.ok(conn.connected(), "mysql_libmysqlclient.createConnection(host, user).connected()");
- if(!conn.connected()) {
- sys.puts("Error:" + conn.connectError());
+ if (!conn.connected()) {
+ sys.puts("Error:" + conn.connectError());
}
conn.close();
@@ -56,8 +56,8 @@ exports.mysql_libmysqlclient_createConnection_3 = function (test) {
var conn = mysql_libmysqlclient.createConnection(cfg.host, cfg.user, cfg.password);
test.ok(conn, "mysql_libmysqlclient.createConnection(host, user, password)");
test.ok(conn.connected(), "mysql_libmysqlclient.createConnection(host, user, password).connected()");
- if(!conn.connected()) {
- sys.puts("Error:" + conn.connectError());
+ if (!conn.connected()) {
+ sys.puts("Error:" + conn.connectError());
}
conn.close();
@@ -70,8 +70,8 @@ exports.mysql_libmysqlclient_createConnection_4_allowed = function (test) {
var conn = mysql_libmysqlclient.createConnection(cfg.host, cfg.user, cfg.password, cfg.database);
test.ok(conn, "mysql_libmysqlclient.createConnection(host, user, password, database)");
test.ok(conn.connected(), "mysql_libmysqlclient.createConnection(host, user, password, database).connected()");
- if(!conn.connected()) {
- sys.puts("Error:" + conn.connectError());
+ if (!conn.connected()) {
+ sys.puts("Error:" + conn.connectError());
}
conn.close();

0 comments on commit 695e8f2

Please sign in to comment.