code style

This commit is contained in:
john30
2017-01-14 13:00:04 +01:00
parent d13b271a05
commit b3bb2e08ac
49 changed files with 1853 additions and 1858 deletions
+6 -7
View File
@@ -16,17 +16,17 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#include "symbol.h"
#include <iostream>
#include <iomanip>
#include <string>
#include "symbol.h"
using namespace std;
static bool error = false;
void verify(bool expectFailMatch, string type, string input,
bool match, string expectStr, string gotStr)
{
bool match, string expectStr, string gotStr) {
match = match && expectStr == gotStr;
if (expectFailMatch) {
if (match) {
@@ -45,11 +45,10 @@ void verify(bool expectFailMatch, string type, string input,
}
}
int main(int argc, char** argv)
{
int main(int argc, char** argv) {
SymbolString sstr(true);
if (argc>1) {
if (argc > 1) {
result_t result = sstr.parseHex(argv[1], true);
if (result != RESULT_OK) {
cout << "parse escaped error: " << getResultCode(result) << endl;
@@ -76,7 +75,7 @@ int main(int argc, char** argv)
ostr.str("");
ostr << nouppercase << setw(2) << hex << setfill('0') << static_cast<unsigned>(gotCrc);
gotStr = ostr.str();
verify(false, "CRC", "10feb5050427a915aa", gotCrc==expectCrc, expectStr, gotStr);
verify(false, "CRC", "10feb5050427a915aa", gotCrc == expectCrc, expectStr, gotStr);
gotStr = sstr.getDataStr(true, false), expectStr = "10feb5050427a915aa77";
verify(false, "unescape", "10feb5050427a915aa", true, expectStr, gotStr);