reworked filereader

This commit is contained in:
john30
2017-03-19 21:18:38 +01:00
parent 380ba2d19d
commit f26dbe7b4f
11 changed files with 971 additions and 640 deletions
+19 -1
View File
@@ -19,6 +19,7 @@
#include <iostream>
#include <iomanip>
#include <string>
#include <unordered_map>
#include "lib/ebus/symbol.h"
using namespace std;
@@ -48,7 +49,6 @@ void verify(bool expectFailMatch, string type, string input,
int main(int argc, char** argv) {
MasterSymbolString mstr;
if (argc > 1) {
result_t result;
if (argc > 2 && strcmp("escaped", argv[1]) == 0) {
@@ -119,5 +119,23 @@ int main(int argc, char** argv) {
verify(false, "data size", "0427a90015a901", sstr.getDataSize() == 4, expectStr, gotStr);
}
int masterCnt = 0, slaveCnt = 0;
for (int i=0; i<256; i++) {
if (isMaster(i)) {
masterCnt++;
} else if (isValidAddress(i, false)) {
slaveCnt++;
}
}
if (masterCnt == 25) {
cout << "count master addresses OK" << endl;
} else {
cout << "count master addresses error: found " << dec << masterCnt << " instead of 25" << endl;
}
if (slaveCnt == 228) {
cout << "count slave addresses OK" << endl;
} else {
cout << "count slave addresses error: found " << dec << slaveCnt << " instead of 228" << endl;
}
return error ? 1 : 0;
}