Changeset 396 for branches


Ignore:
Timestamp:
02/08/14 09:59:14 (6 years ago)
Author:
jls17
Message:
  • replaced magic constant in CARSchemaList (hopefully this avoid errors in the future)
Location:
branches/work_304/lists
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • branches/work_304/lists/ARSchemaList.cpp

    r395 r396  
    455455                ARValueList& row = valueList.valueListList[valPos]; 
    456456                 
    457                 if (row.numItems < 4 || row.valueList[1].dataType != AR_DATA_TYPE_CHAR) 
     457                if (row.numItems < SchemaDbQueryBuilder::ExpectedColumnCount() || row.valueList[1].dataType != AR_DATA_TYPE_CHAR) 
    458458                        continue; 
    459459                 
  • branches/work_304/lists/support/SchemaDbQueryBuilder.cpp

    r393 r396  
    4444} 
    4545 
     46unsigned int SchemaDbQueryBuilder::ExpectedColumnCount() 
     47{ 
     48        return 4; 
     49} 
     50 
    4651void SchemaDbQueryBuilder::AppendStatement(std::ostream &strm) 
    4752{ 
  • branches/work_304/lists/support/SchemaDbQueryBuilder.h

    r395 r396  
    2323        ~SchemaDbQueryBuilder(void); 
    2424 
     25        static unsigned int ExpectedColumnCount(); 
    2526        const char* GetNextQuery(); 
    2627        void SetLastReceivedSchemaId(int schemaId); 
  • branches/work_304/lists/support/SchemaDbQueryBuilderTest.cpp

    r393 r396  
    2020} 
    2121 
     22TEST(SchemaDbQueryBuilder, ValidateQueryColumCount) 
     23{ 
     24        ASSERT_EQ(4, SchemaDbQueryBuilder::ExpectedColumnCount()); 
     25} 
     26 
    2227class SchemaDbQueryWithMax100Results : public Test 
    2328{ 
     
    3843} 
    3944 
    40 #define SECOND100_SQL_STATEMENT_WITH_QUERY BASE_STATEMENT BASE_QUERY(112) BASE_ORDER 
     45#define SECOND100_SQL_STATEMENT_WITH_QUERY (BASE_STATEMENT BASE_QUERY(112) BASE_ORDER) 
    4146TEST_F(SchemaDbQueryWithMax100Results, SecondQueryShouldStartAtLastSchemaId) 
    4247{ 
Note: See TracChangeset for help on using the changeset viewer.