-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsoftware.js
39 lines (33 loc) · 1010 Bytes
/
software.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
// module "Software
var DbMgr = require("./db2");
var Version = require("./version");
exports.doTest = function ( tn, req, res ) {
if ( tn == "rubbingOK") {
return( testRubbingOK(req, res) );
} else if ( tn == "brassOK") {
return( testRubbingOK()() );
} else if ( tn == "churchOK"){
return( testRubbingOK()() );
}
};
// Simple Q/A Progress Tests
// - return a triple
// - num ok
// - total num
// - array of names of not ok
var testRubbingOK = function(req, res) {
return ( DbMgr.rubbingAll( "", {}, function(ra) {
var total = ra.length;
var numOK = 0;
var notOKarray = [];
ra.forEach( function(r) {
if ((r.brass) && (r.brass != "unknown")) {
numOK++;
} else {
notOKarray.push( [r.vlcn, r.name]);
}
});
console.log("nok: "+numOK+" t:"+total);
res.send([ numOK, total, notOKarray, Version.VersionString() ]);
}) );
};