1
0
mirror of https://github.com/mariadb-corporation/mariadb-columnstore-engine.git synced 2025-07-29 08:21:15 +03:00

Reformat all code to coding standard

This commit is contained in:
Andrew Hutchings
2017-10-26 17:18:17 +01:00
parent 4985f3456e
commit 01446d1e22
1296 changed files with 403852 additions and 353747 deletions

View File

@ -30,118 +30,122 @@ using namespace std;
#include "calpontsystemcatalog.h"
using namespace execplan;
class TDriver23 : public CppUnit::TestFixture {
class TDriver23 : public CppUnit::TestFixture
{
CPPUNIT_TEST_SUITE( TDriver23 );
CPPUNIT_TEST_SUITE( TDriver23 );
CPPUNIT_TEST( test1 );
CPPUNIT_TEST( test2 );
CPPUNIT_TEST( test1 );
CPPUNIT_TEST( test2 );
CPPUNIT_TEST_SUITE_END();
CPPUNIT_TEST_SUITE_END();
private:
public:
boost::shared_ptr<CalpontSystemCatalog> syscat;
CalpontSystemCatalog::OID o;
CalpontSystemCatalog::ColType ct;
void setUp() {
syscat = CalpontSystemCatalog::makeCalpontSystemCatalog();
}
boost::shared_ptr<CalpontSystemCatalog> syscat;
CalpontSystemCatalog::OID o;
CalpontSystemCatalog::ColType ct;
void tearDown() {
CalpontSystemCatalog::removeCalpontSystemCatalog();
}
void setUp()
{
syscat = CalpontSystemCatalog::makeCalpontSystemCatalog();
}
void test1() {
o = 1009;
ct = syscat->colType(o);
/*
cw: 4 dt: int do: 0 lo: 0 to: 0 cp: 8 sc: 0 pr: 10 od: 1009 ct: 0
*/
void tearDown()
{
CalpontSystemCatalog::removeCalpontSystemCatalog();
}
CPPUNIT_ASSERT(ct.columnOID == 1009);
CPPUNIT_ASSERT(ct.colWidth == 4);
CPPUNIT_ASSERT(ct.colPosition == 8);
CPPUNIT_ASSERT(ct.compressionType == 0);
void test1()
{
o = 1009;
ct = syscat->colType(o);
/*
cw: 4 dt: int do: 0 lo: 0 to: 0 cp: 8 sc: 0 pr: 10 od: 1009 ct: 0
*/
o = 2001;
ct = syscat->colType(o);
CPPUNIT_ASSERT(ct.columnOID == 0);
CPPUNIT_ASSERT(ct.columnOID == 1009);
CPPUNIT_ASSERT(ct.colWidth == 4);
CPPUNIT_ASSERT(ct.colPosition == 8);
CPPUNIT_ASSERT(ct.compressionType == 0);
ct = syscat->colTypeDct(o);
/*
cw: 65 dt: varchar do: 2001 lo: 2002 to: 2003 cp: 0 sc: 0 pr: 10 od: 1001 ct: 0
*/
CPPUNIT_ASSERT(ct.columnOID == 1001);
CPPUNIT_ASSERT(ct.colWidth == 65);
CPPUNIT_ASSERT(ct.ddn.dictOID == 2001);
CPPUNIT_ASSERT(ct.colPosition == 0);
CPPUNIT_ASSERT(ct.compressionType == 0);
o = 2001;
ct = syscat->colType(o);
CPPUNIT_ASSERT(ct.columnOID == 0);
o = 3024;
ct = syscat->colType(o);
/*
int32_t colWidth;
ConstraintType constraintType;
ColDataType colDataType;
DictOID ddn;
boost::any defaultValue;
int32_t colPosition; // temporally put here. may need to have ColInfo struct later
int32_t scale; //number after decimal points
int32_t precision;
int32_t compressionType;
OID columnOID;
cw: 25 dt: char do: 3027 lo: -2147483648 to: -2147483648 cp: 1 sc: 0 pr: 10 od: 3024 comtype: 0
*/
CPPUNIT_ASSERT(ct.columnOID == 3024);
CPPUNIT_ASSERT(ct.colWidth == 25);
CPPUNIT_ASSERT(ct.ddn.dictOID == 3027);
CPPUNIT_ASSERT(ct.colPosition == 1);
CPPUNIT_ASSERT(ct.scale == 0);
CPPUNIT_ASSERT(ct.precision == 10);
CPPUNIT_ASSERT(ct.compressionType == 0);
ct = syscat->colTypeDct(o);
/*
cw: 65 dt: varchar do: 2001 lo: 2002 to: 2003 cp: 0 sc: 0 pr: 10 od: 1001 ct: 0
*/
CPPUNIT_ASSERT(ct.columnOID == 1001);
CPPUNIT_ASSERT(ct.colWidth == 65);
CPPUNIT_ASSERT(ct.ddn.dictOID == 2001);
CPPUNIT_ASSERT(ct.colPosition == 0);
CPPUNIT_ASSERT(ct.compressionType == 0);
o = 3027;
ct = syscat->colType(o);
/*
cw: 0 dt: medint do: 0 lo: 0 to: 0 cp: -1 sc: 0 pr: -1 od: 0 comtype: 0
*/
CPPUNIT_ASSERT(ct.columnOID == 0);
o = 3024;
ct = syscat->colType(o);
/*
int32_t colWidth;
ConstraintType constraintType;
ColDataType colDataType;
DictOID ddn;
boost::any defaultValue;
int32_t colPosition; // temporally put here. may need to have ColInfo struct later
int32_t scale; //number after decimal points
int32_t precision;
int32_t compressionType;
OID columnOID;
cw: 25 dt: char do: 3027 lo: -2147483648 to: -2147483648 cp: 1 sc: 0 pr: 10 od: 3024 comtype: 0
*/
CPPUNIT_ASSERT(ct.columnOID == 3024);
CPPUNIT_ASSERT(ct.colWidth == 25);
CPPUNIT_ASSERT(ct.ddn.dictOID == 3027);
CPPUNIT_ASSERT(ct.colPosition == 1);
CPPUNIT_ASSERT(ct.scale == 0);
CPPUNIT_ASSERT(ct.precision == 10);
CPPUNIT_ASSERT(ct.compressionType == 0);
ct = syscat->colTypeDct(o);
CPPUNIT_ASSERT(ct.columnOID == 3024);
CPPUNIT_ASSERT(ct.colWidth == 25);
CPPUNIT_ASSERT(ct.ddn.dictOID == 3027);
CPPUNIT_ASSERT(ct.colPosition == 1);
CPPUNIT_ASSERT(ct.scale == 0);
CPPUNIT_ASSERT(ct.precision == 10);
CPPUNIT_ASSERT(ct.compressionType == 0);
o = 3027;
ct = syscat->colType(o);
/*
cw: 0 dt: medint do: 0 lo: 0 to: 0 cp: -1 sc: 0 pr: -1 od: 0 comtype: 0
*/
CPPUNIT_ASSERT(ct.columnOID == 0);
}
ct = syscat->colTypeDct(o);
CPPUNIT_ASSERT(ct.columnOID == 3024);
CPPUNIT_ASSERT(ct.colWidth == 25);
CPPUNIT_ASSERT(ct.ddn.dictOID == 3027);
CPPUNIT_ASSERT(ct.colPosition == 1);
CPPUNIT_ASSERT(ct.scale == 0);
CPPUNIT_ASSERT(ct.precision == 10);
CPPUNIT_ASSERT(ct.compressionType == 0);
void test2()
{
syscat->identity(CalpontSystemCatalog::EC);
test1();
}
}
};
void test2()
{
syscat->identity(CalpontSystemCatalog::EC);
test1();
}
};
CPPUNIT_TEST_SUITE_REGISTRATION( TDriver23 );
#include <cppunit/extensions/TestFactoryRegistry.h>
#include <cppunit/ui/text/TestRunner.h>
int main( int argc, char **argv)
int main( int argc, char** argv)
{
CppUnit::TextUi::TestRunner runner;
CppUnit::TestFactoryRegistry &registry = CppUnit::TestFactoryRegistry::getRegistry();
runner.addTest( registry.makeTest() );
bool wasSuccessful = runner.run( "", false );
return (wasSuccessful ? 0 : 1);
CppUnit::TextUi::TestRunner runner;
CppUnit::TestFactoryRegistry& registry = CppUnit::TestFactoryRegistry::getRegistry();
runner.addTest( registry.makeTest() );
bool wasSuccessful = runner.run( "", false );
return (wasSuccessful ? 0 : 1);
}