Code-style consistency improvement:

Apply clang-format-all.sh using the _clang-format file through all the cpp/.h files.
make sure not to apply it to certain serialization structures, since some parser expects the * as part of the name, instead of type.
This commit contains no other changes aside from adding and applying clang-format-all.sh
This commit is contained in:
erwincoumans
2018-09-23 14:17:31 -07:00
parent b73b05e9fb
commit ab8f16961e
1773 changed files with 1081087 additions and 474249 deletions

View File

@@ -3,13 +3,12 @@
#ifndef ENABLE_GTEST
#include <assert.h>
#define ASSERT_EQ(a,b) assert((a)==(b));
#define ASSERT_EQ(a, b) assert((a) == (b));
#else
#include <gtest/gtest.h>
#define printf
#endif
void testMinitaurLogging()
{
const char* fileName = "d:/logTest.txt";
@@ -20,29 +19,28 @@ void testMinitaurLogging()
int status = readMinitaurLogFile(fileName, structNames, structTypes, logRecords, verbose);
for (int i=0;i<logRecords.size();i++)
for (int i = 0; i < logRecords.size(); i++)
{
for (int j=0;j<structTypes.size();j++)
for (int j = 0; j < structTypes.size(); j++)
{
switch (structTypes[j])
{
case 'I':
{
int v = logRecords[i].m_values[j].m_intVal;
printf("record %d, %s = %d\n",i,structNames[j].c_str(),v);
printf("record %d, %s = %d\n", i, structNames[j].c_str(), v);
break;
}
case 'f':
{
float v = logRecords[i].m_values[j].m_floatVal;
printf("record %d, %s = %f\n",i,structNames[j].c_str(),v);
printf("record %d, %s = %f\n", i, structNames[j].c_str(), v);
break;
}
case 'B':
{
int v = logRecords[i].m_values[j].m_charVal;
printf("record %d, %s = %d\n",i,structNames[j].c_str(),v);
printf("record %d, %s = %d\n", i, structNames[j].c_str(), v);
break;
}
default:
@@ -54,28 +52,26 @@ void testMinitaurLogging()
}
#ifdef ENABLE_GTEST
TEST(RobotLoggingTest, LogMinitaur) {
testMinitaurLogging();
TEST(RobotLoggingTest, LogMinitaur)
{
testMinitaurLogging();
}
#endif
int main(int argc, char* argv[])
{
//b3SetCustomPrintfFunc(myprintf);
//b3SetCustomWarningMessageFunc(myprintf);
//b3SetCustomPrintfFunc(myprintf);
//b3SetCustomWarningMessageFunc(myprintf);
#ifdef ENABLE_GTEST
#if _MSC_VER
_CrtSetDbgFlag ( _CRTDBG_ALLOC_MEM_DF | _CRTDBG_LEAK_CHECK_DF );
//void *testWhetherMemoryLeakDetectionWorks = malloc(1);
_CrtSetDbgFlag(_CRTDBG_ALLOC_MEM_DF | _CRTDBG_LEAK_CHECK_DF);
//void *testWhetherMemoryLeakDetectionWorks = malloc(1);
#endif
::testing::InitGoogleTest(&argc, argv);
return RUN_ALL_TESTS();
::testing::InitGoogleTest(&argc, argv);
return RUN_ALL_TESTS();
#else
testMinitaurLogging();
#endif
}