test_get_time_unit Subroutine

public subroutine test_get_time_unit()

Arguments

None

Calls

proc~~test_get_time_unit~~CallsGraph proc~test_get_time_unit test_get_time_unit assertequal assertequal proc~test_get_time_unit->assertequal get_time_unit get_time_unit proc~test_get_time_unit->get_time_unit

Source Code

   subroutine test_get_time_unit()
      integer(kind(TIME_UNIT)) :: expected, actual
      character(len=8) :: unit_name

         unit_name = 'year'
         expected = YEAR_TIME_UNIT
         actual = get_time_unit(unit_name)
         @assertEqual(expected, actual, 'Mismatch for ' // unit_name)
         unit_name = unit_name // 's'
         actual = get_time_unit(unit_name)
         @assertEqual(expected, actual, 'Mismatch for ' // unit_name)

         unit_name = 'month'
         expected = MONTH_TIME_UNIT
         actual = get_time_unit(unit_name)
         @assertEqual(expected, actual, 'Mismatch for ' // unit_name)
         unit_name = unit_name // 's'
         actual = get_time_unit(unit_name)
         @assertEqual(expected, actual, 'Mismatch for ' // unit_name)

         unit_name = 'day'
         expected = DAY_TIME_UNIT
         actual = get_time_unit(unit_name)
         @assertEqual(expected, actual, 'Mismatch for ' // unit_name)
         unit_name = unit_name // 's'
         actual = get_time_unit(unit_name)
         @assertEqual(expected, actual, 'Mismatch for ' // unit_name)

         unit_name = 'hour'
         expected = HOUR_TIME_UNIT
         actual = get_time_unit(unit_name)
         @assertEqual(expected, actual, 'Mismatch for ' // unit_name)
         unit_name = unit_name // 's'
         actual = get_time_unit(unit_name)
         @assertEqual(expected, actual, 'Mismatch for ' // unit_name)

         unit_name = 'minute'
         expected = MINUTE_TIME_UNIT
         actual = get_time_unit(unit_name)
         @assertEqual(expected, actual, 'Mismatch for ' // unit_name)
         unit_name = unit_name // 's'
         actual = get_time_unit(unit_name)
         @assertEqual(expected, actual, 'Mismatch for ' // unit_name)

         unit_name = 'second'
         expected = SECOND_TIME_UNIT
         actual = get_time_unit(unit_name)
         @assertEqual(expected, actual, 'Mismatch for ' // unit_name)
         unit_name = unit_name // 's'
         actual = get_time_unit(unit_name)
         @assertEqual(expected, actual, 'Mismatch for ' // unit_name)
      
         unit_name = 'furlong'
         expected = UNKNOWN_TIME_UNIT
         actual = get_time_unit(unit_name)
         @assertEqual(expected, actual, 'Mismatch for ' // unit_name)

   end subroutine test_get_time_unit