Hello everybody,
i want to undertake some unit tests and a few functional tests on a working system. However i have a datastructure that mostly consists of a few arrays in an object (well its fortran, so not a real object, but you get the idea.) How would an example look like to unit test a datastructure? all examples i have seen so far returned a single value that was then tested. how do i do this with a datastructure that consists of arrays?
If i could get an example in funit, that would be great. Here is an example of my datastructure:
type :: myownobject
integer :: front(300)
integer :: end(300)
integer :: size
end type
subroutine getmesugar(myob, moredata)
type(myownobject), intent(inout) :: myob
integer, intent(in) :: moredata (20)
! do something with myownobject
! perhaps add the data after a sanity check
! using the new data and the object
end subroutine
i know its perhaps a simple question, but i am really just starting out with unit testing. i am reading The Art Of Unit Testing by Roy Osherove.