#include #include "validate.h" #include "funcList.h" bool ValidateShiftLeft( const string& operation ) { if( operation != "shiftLeft" ) return false; ln a, c, d; size_t dist; cin >> a >> dist >> c; d = a << dist; if( c != d ) { errorCount++; cerr << "Error in shift left" << endl; } d = a; d <<= dist; if( c != d ) { errorCount++; cerr << "Error in shift left equals" << endl; d = a; d <<= dist; } return true; } // ============================================================ bool ValidateShiftRight( const string& operation ) { if( operation != "shiftRight" ) return false; ln a, c, d; size_t dist; cin >> a >> dist >> c; d = a >> dist; if( c != d ) { errorCount++; cerr << "Error in shift right" << endl; } d = a; d >>= dist; if( c != d ) { errorCount++; cerr << "Error in shift right equals" << endl; d = a; d >>= dist; } return true; } // ============================================================ static TestFunctionList RegFunc1( ValidateShiftLeft ); static TestFunctionList RegFunc2( ValidateShiftRight );