⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 test_suite.c

📁 24位AD压力实验板 protell99se打开
💻 C
📖 第 1 页 / 共 2 页
字号:
  setDate( 2009, 10, 25 );
  TI_hour = 0x12;
  TI_minute = 0x59;
  TI_second = 0x59;
  TI_PM = 0;
  TI_dayLightZone = EU_DAYLIGHT_SAVINGS;
  incrementSeconds();
  if( TI_second != 0x00 ){ return 87; }
  if( TI_minute != 0x00 ){ return 88; }
  if( TI_hour != 0x12 ){ return 89; }
  if( TI_day != 0x25 ){ return 90; }
  if( TI_month != OCTOBER ){ return 91; }
  if( TI_year != 0x2009 ){ return 92; }
  if( TI_dayLightSavings != 0x00 ){ return 93; }

//------------------------------------------------------------------------------
// Set Date to 10/30/2005 12:59:59 AM add one second, should be 12AM - middle 'last Sunday'
//------------------------------------------------------------------------------
  setDate( 2005, 10, 30 );
  TI_hour = 0x12;
  TI_minute = 0x59;
  TI_second = 0x59;
  TI_PM = 0;
  TI_dayLightZone = EU_DAYLIGHT_SAVINGS;
  incrementSeconds();
  if( TI_second != 0x00 ){ return 94; }
  if( TI_minute != 0x00 ){ return 95; }
  if( TI_hour != 0x12 ){ return 96; }
  if( TI_day != 0x30 ){ return 97; }
  if( TI_month != OCTOBER ){ return 98; }
  if( TI_year != 0x2005 ){ return 99; }
  if( TI_dayLightSavings != 0x00 ){ return 100; }

//------------------------------------------------------------------------------
// Set Date to 10/31/2004 12:59:59 AM add one second, should be 12AM - last 'last Sunday'
//------------------------------------------------------------------------------
  setDate( 2004, 10, 31 );
  TI_hour = 0x12;
  TI_minute = 0x59;
  TI_second = 0x59;
  TI_PM = 0;
  TI_dayLightZone = EU_DAYLIGHT_SAVINGS;
  incrementSeconds();
  if( TI_second != 0x00 ){ return 101; }
  if( TI_minute != 0x00 ){ return 102; }
  if( TI_hour != 0x12 ){ return 103; }
  if( TI_day != 0x31 ){ return 104; }
  if( TI_month != OCTOBER ){ return 105; }
  if( TI_year != 0x2004 ){ return 106; }
  if( TI_dayLightSavings != 0x00 ){ return 107; }


//------------------------------------------------------------------------------
// Set Date to 10/23/2005 12:59:59 AM add one second, should be 1 AM - second to last Sunday
//------------------------------------------------------------------------------
  setDate( 2005, 10, 23 );
  TI_hour = 0x12;
  TI_minute = 0x59;
  TI_second = 0x59;
  TI_PM = 0;
  TI_dayLightZone = EU_DAYLIGHT_SAVINGS;
  incrementSeconds();
  if( TI_second != 0x00 ){ return 108; }
  if( TI_minute != 0x00 ){ return 109; }
  if( TI_hour != 0x01 ){ return 110; }
  if( TI_day != 0x23 ){ return 111; }
  if( TI_month != OCTOBER ){ return 112; }
  if( TI_year != 0x2005 ){ return 113; }
  if( TI_dayLightSavings != 0x01 ){ return 114; }

//------------------------------------------------------------------------------
// Set Date to 4/1/2001 1:59:59 AM add one second, should be 3AM - first 'last Sunday'
//------------------------------------------------------------------------------
  setDate( 2001, 4, 1 );
  TI_hour = 0x01;
  TI_minute = 0x59;
  TI_second = 0x59;
  TI_PM = 0;
  TI_dayLightZone = US_DAYLIGHT_SAVINGS;
  incrementSeconds();
  if( TI_second != 0x00 ){ return 115; }
  if( TI_minute != 0x00 ){ return 116; }
  if( TI_hour != 0x3 ){ return 117; }
  if( TI_day != 0x01 ){ return 118; }
  if( TI_month != APRIL ){ return 119; }
  if( TI_year != 0x2001 ){ return 120; }
  if( TI_dayLightSavings != 0x01 ){ return 121; }

//------------------------------------------------------------------------------
// Set Date to 4/4/2004 1:59:59 AM add one second, should be 3AM  - middle 'last Sunday'
//------------------------------------------------------------------------------
  setDate( 2004, 4, 4 );
  TI_hour = 0x01;
  TI_minute = 0x59;
  TI_second = 0x59;
  TI_PM = 0;
  TI_dayLightZone = US_DAYLIGHT_SAVINGS;
  incrementSeconds();
  if( TI_second != 0x00 ){ return 122; }
  if( TI_minute != 0x00 ){ return 123; }
  if( TI_hour != 0x3 ){ return 124; }
  if( TI_day != 0x4 ){ return 125; }
  if( TI_month != APRIL ){ return 126; }
  if( TI_year != 0x2004 ){ return 127; }
  if( TI_dayLightSavings != 0x01 ){ return 128; }

//------------------------------------------------------------------------------
// Set Date to 4/7/2013 1:59:59 AM add one second, should be 3AM - last 'last Sunday'
//------------------------------------------------------------------------------
  setDate( 2013, 4, 7 );
  TI_hour = 0x01;
  TI_minute = 0x59;
  TI_second = 0x59;
  TI_PM = 0;
  TI_dayLightZone = US_DAYLIGHT_SAVINGS;
  incrementSeconds();
  if( TI_second != 0x00 ){ return 129; }
  if( TI_minute != 0x00 ){ return 130; }
  if( TI_hour != 0x3 ){ return 131; }
  if( TI_day != 0x07 ){ return 132; }
  if( TI_month != APRIL ){ return 133; }
  if( TI_year != 0x2013 ){ return 134; }
  if( TI_dayLightSavings != 0x01 ){ return 135; }

//------------------------------------------------------------------------------
// Set Date to 4/8/2012 1:59:59 AM add one second, should be 2AM - second sunday
//------------------------------------------------------------------------------
  setDate( 2012, 4, 8 );
  TI_hour = 0x01;
  TI_minute = 0x59;
  TI_second = 0x59;
  TI_PM = 0;
  TI_dayLightZone = US_DAYLIGHT_SAVINGS;
  incrementSeconds();
  if( TI_second != 0x00 ){ return 136; }
  if( TI_minute != 0x00 ){ return 137; }
  if( TI_hour != 0x2 ){ return 138; }
  if( TI_day != 0x08 ){ return 139; }
  if( TI_month != APRIL ){ return 140; }
  if( TI_year != 0x2012 ){ return 141; }
  if( TI_dayLightSavings != 0x01 ){ return 142; }

//------------------------------------------------------------------------------
// Set Date to 10/25/2009 1:59:59 AM add one second, should be 1AM - first 'last Sunday'
//------------------------------------------------------------------------------
  setDate( 2009, 10, 25 );
  TI_hour = 0x01;
  TI_minute = 0x59;
  TI_second = 0x59;
  TI_PM = 0;
  TI_dayLightZone = US_DAYLIGHT_SAVINGS;
  incrementSeconds();
  if( TI_second != 0x00 ){ return 143; }
  if( TI_minute != 0x00 ){ return 144; }
  if( TI_hour != 0x1 ){ return 145; }
  if( TI_day != 0x25 ){ return 146; }
  if( TI_month != OCTOBER ){ return 147; }
  if( TI_year != 0x2009 ){ return 148; }
  if( TI_dayLightSavings != 0x00 ){ return 149; }

//------------------------------------------------------------------------------
// Set Date to 10/30/2005 1:59:59 AM add one second, should be 1AM - middle 'last Sunday'
//------------------------------------------------------------------------------
  setDate( 2005, 10, 30 );
  TI_hour = 0x01;
  TI_minute = 0x59;
  TI_second = 0x59;
  TI_PM = 0;
  TI_dayLightZone = US_DAYLIGHT_SAVINGS;
  incrementSeconds();
  if( TI_second != 0x00 ){ return 150; }
  if( TI_minute != 0x00 ){ return 151; }
  if( TI_hour != 0x1 ){ return 152; }
  if( TI_day != 0x030 ){ return 153; }
  if( TI_month != OCTOBER ){ return 154; }
  if( TI_year != 0x2005 ){ return 155; }
  if( TI_dayLightSavings != 0x00 ){ return 156; }

//------------------------------------------------------------------------------
// Set Date to 10/31/2004 1:59:59 AM add one second, should be 1AM - last 'last Sunday'
//------------------------------------------------------------------------------
  setDate( 2004, 10, 31 );
  TI_hour = 0x01;
  TI_minute = 0x59;
  TI_second = 0x59;
  TI_PM = 0;
  TI_dayLightZone = US_DAYLIGHT_SAVINGS;
  incrementSeconds();
  if( TI_second != 0x00 ){ return 157; }
  if( TI_minute != 0x00 ){ return 158; }
  if( TI_hour != 0x1 ){ return 159; }
  if( TI_day != 0x031 ){ return 160; }
  if( TI_month != OCTOBER ){ return 161; }
  if( TI_year != 0x2004 ){ return 162; }
  if( TI_dayLightSavings != 0x00 ){ return 163; }

//------------------------------------------------------------------------------
// Set Date to 10/22/2006 1:59:59 AM add one second, should be 2AM - second to last sunday
//------------------------------------------------------------------------------
  setDate( 2006, 10, 22 );
  TI_hour = 0x01;
  TI_minute = 0x59;
  TI_second = 0x59;
  TI_PM = 0;
  TI_dayLightZone = US_DAYLIGHT_SAVINGS;
  incrementSeconds();
  if( TI_second != 0x00 ){ return 164; }
  if( TI_minute != 0x00 ){ return 165; }
  if( TI_hour != 0x2 ){ return 166; }
  if( TI_day != 0x022 ){ return 167; }
  if( TI_month != OCTOBER ){ return 168; }
  if( TI_year != 0x2006 ){ return 169; }
  if( TI_dayLightSavings != 0x01 ){ return 170; }

//------------------------------------------------------------------------------
// Tests for 'infinite loop' on daylight adjust for US
// Set Date to 10/31/2004 1:59:59 AM add one second, should be 1AM - last sunday
// then set minutes and seconds to 59, add one second.. should now be 2AM
//------------------------------------------------------------------------------
  setDate( 2004, 10, 31 );
  TI_hour = 0x01;
  TI_minute = 0x59;
  TI_second = 0x59;
  TI_PM = 0;
  TI_dayLightZone = US_DAYLIGHT_SAVINGS;
  incrementSeconds();
  if( TI_second != 0x00 ){ return 171; }
  if( TI_minute != 0x00 ){ return 172; }
  if( TI_hour != 0x1 ){ return 173; }
  if( TI_day != 0x031 ){ return 174; }
  if( TI_month != OCTOBER ){ return 175; }
  if( TI_year != 0x2004 ){ return 176; }
  if( TI_dayLightSavings != 0x00 ){ return 177; }
  TI_minute = 0x59;
  TI_second = 0x59;
  incrementSeconds();
  if( TI_second != 0x00 ){ return 178; }
  if( TI_minute != 0x00 ){ return 179; }
  if( TI_hour != 0x2 ){ return 180; }
  if( TI_day != 0x031 ){ return 181; }
  if( TI_month != OCTOBER ){ return 182; }
  if( TI_year != 0x2004 ){ return 183; }
  if( TI_dayLightSavings != 0x00 ){ return 184; }
//------------------------------------------------------------------------------
// Tests for 'infinite loop' on daylight adjust for EU
// Set Date to 10/23/2005 12:59:59 AM add one second, should be 12 AM - last sunday
// then set minutes and seconds to 59, add one second.. should now be 1AM
//------------------------------------------------------------------------------
  setDate( 2005, 10, 30 );
  TI_hour = 0x12;
  TI_minute = 0x59;
  TI_second = 0x59;
  TI_PM = 0;
  TI_dayLightZone = EU_DAYLIGHT_SAVINGS;
  incrementSeconds();
  if( TI_second != 0x00 ){ return 185; }
  if( TI_minute != 0x00 ){ return 186; }
  if( TI_hour != 0x12 ){ return 187; }
  if( TI_day != 0x30 ){ return 188; }
  if( TI_month != OCTOBER ){ return 189; }
  if( TI_year != 0x2005 ){ return 190; }
  if( TI_dayLightSavings != 0x00 ){ return 191; }
  TI_minute = 0x59;
  TI_second = 0x59;
  incrementSeconds();
  if( TI_second != 0x00 ){ return 192; }
  if( TI_minute != 0x00 ){ return 193; }
  if( TI_hour != 0x01 ){ return 194; }
  if( TI_day != 0x30 ){ return 195; }
  if( TI_month != OCTOBER ){ return 196; }
  if( TI_year != 0x2005 ){ return 197; }
  if( TI_dayLightSavings != 0x00 ){ return 198; }

//------------------------------------------------------------------------------
// Tests for all values of get24Hour
//------------------------------------------------------------------------------

  TI_PM = 0;
  TI_hour = 0x12;
  if( get24Hour() != 0x00 ){ return 199; }
  TI_hour = 0x1;
  if( get24Hour() != 0x01 ){ return 200; }
  TI_hour = 0x2;
  if( get24Hour() != 0x02 ){ return 201; }
  TI_hour = 0x3;
  if( get24Hour() != 0x03 ){ return 202; }
  TI_hour = 0x4;
  if( get24Hour() != 0x04 ){ return 203; }
  TI_hour = 0x5;
  if( get24Hour() != 0x05 ){ return 204; }
  TI_hour = 0x6;
  if( get24Hour() != 0x06 ){ return 205; }
  TI_hour = 0x7;
  if( get24Hour() != 0x07 ){ return 206; }
  TI_hour = 0x8;
  if( get24Hour() != 0x08 ){ return 207; }
  TI_hour = 0x9;
  if( get24Hour() != 0x09 ){ return 208; }
  TI_hour = 0x10;
  if( get24Hour() != 0x10 ){ return 209; }
  TI_hour = 0x11;
  if( get24Hour() != 0x11 ){ return 210; }

  TI_PM = 1;
  TI_hour = 0x12;
  if( get24Hour() != 0x12 ){ return 211; }
  TI_hour = 0x1;
  if( get24Hour() != 0x13 ){ return 212; }
  TI_hour = 0x2;
  if( get24Hour() != 0x14 ){ return 213; }
  TI_hour = 0x3;
  if( get24Hour() != 0x15 ){ return 214; }
  TI_hour = 0x4;
  if( get24Hour() != 0x16 ){ return 215; }
  TI_hour = 0x5;
  if( get24Hour() != 0x17 ){ return 216; }
  TI_hour = 0x6;
  if( get24Hour() != 0x18 ){ return 217; }
  TI_hour = 0x7;
  if( get24Hour() != 0x19 ){ return 218; }
  TI_hour = 0x8;
  if( get24Hour() != 0x20 ){ return 219; }
  TI_hour = 0x9;
  if( get24Hour() != 0x21 ){ return 220; }
  TI_hour = 0x10;
  if( get24Hour() != 0x22 ){ return 221; }
  TI_hour = 0x11;
  if( get24Hour() != 0x23 ){ return 222; }

//------------------------------------------------------------------------------
// Tests for testLeap
//------------------------------------------------------------------------------
  TI_year = 0x2004;
  testLeap();
  if( !LEAP_YEAR ){ return 223; }
  TI_year = 0x2005;
  testLeap();
  if( LEAP_YEAR ){ return 224; }

  return 0;
} // test suite





⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -