Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unit tests for src/copybf.f, src/copymg.f, src/copysb.f, src/cpbfdx.f, src/cpdxmm.f, src/cpymem.f, src/cpyupd.f #33

Closed
edwardhartnett opened this issue Oct 28, 2020 · 10 comments
Assignees
Labels
test Testing is important!

Comments

@edwardhartnett
Copy link
Contributor

src/copybf.f, src/copymg.f, src/copysb.f, src/cpbfdx.f, src/cpdxmm.f, src/cpymem.f, src/cpyupd.f are all untested

@jbathegit
Copy link
Collaborator

I think I can cover src/cpbfdx.f within a new test program that I'm currently working on for #51, #52, #53, and #54.

@edwardhartnett
Copy link
Contributor Author

edwardhartnett commented Feb 16, 2023

Codes with apparently zero testing include:

  1. bort and it's variants.
  2. copybf
  3. cwbng
  4. dlloctbf
  5. drstpl
  6. invmrg
  7. mesgbf
  8. mrginv
  9. nevn
  10. newwin
  11. nwords
  12. openbt
  13. trybump
  14. ufbcpy
  15. ufbcup
  16. ufbget
  17. ufbin3
  18. ufbinx
  19. ufborv
  20. ufbtam

So if these codes are important, they need to be tested.

If they are not, they need to be removed. ;-)

Getting at least a few tests for each subprogram should be a top priority unless there are urgent bugfixes or new releases that need to get out to users...

These tests should be written in the style of intest1.F90:

  • They should all be *.F90 codes.
  • They should return non-zero for an error, and exit normally for success.
  • Scanning of the output is not necessary, so in CMakeLists.txt these are just ordinary Fortran test programs that are compiled and run, just like intest1.
  • They should be well-documented as to what they are, and what they are trying to do.

@jbathegit
Copy link
Collaborator

jbathegit commented Feb 25, 2023

With #331 we now have coverage for the following subprograms from the above list:

  • 2 (copybf)
  • 3 (cwbmg)
  • 4 (dlloctbf)
  • 7 (mesgbf)
  • 14 (ufbcpy)
  • 16 (ufbget)
  • 18 (ufbinx)
  • 20 (ufbtam)

@jbathegit
Copy link
Collaborator

With the latest updates to #331 we now also have coverage for:

  • 6 (invmrg)
  • 8 (mrginv)
  • 9 (nevn)
  • 11 (nwords)
  • 13 (trybump)
  • 17 (ufbin3)
  • 19 (ufbovr)

@edwardhartnett edwardhartnett added the test Testing is important! label Mar 13, 2023
@edwardhartnett
Copy link
Contributor Author

edwardhartnett commented Mar 25, 2023

@jbathegit here's a question about copymg.

If I run this code:

        open(unit = 11, file = 'testfiles/IN_2', form = 'UNFORMATTED', iostat = ios)
        if (ios .ne. 0) stop 3
        call openbf(11, 'IN', 12)
        call openbf(12, 'OUT', 13)
        call copymg(11, 12)     

I get this error:

***********BUFR ARCHIVE LIBRARY ABORT**************
BUFRLIB: COPYMG - A MESSAGE MUST BE OPEN IN INPUT BUFR FILE, NONE ARE
***********BUFR ARCHIVE LIBRARY ABORT**************

OK, the documentation had the answer!

Now I have:

        open(unit = 11, file = 'testfiles/IN_2', form = 'UNFORMATTED', iostat = ios)
        if (ios .ne. 0) stop 3
        call openbf(11, 'IN', 11)
        call readmg(11, char_val_8, jdate, iret)

And it finds a message. ;-)

@edwardhartnett
Copy link
Contributor Author

I am taking a pass though these functions to see if bort testing can be improved.

Here's the current testing levels for these functions:

Function Coverage
copybf 100
copymg 77
copysb 68
cpbfdx 100
cpdxmm 63
cpymem 79
cpyupd 50

These numbers will improve slightly when #415 is merged.

@edwardhartnett
Copy link
Contributor Author

Here's the current testing levels for these functions:

Function Coverage
copybf 100
copymg 91.4
copysb 78.9
cpbfdx 100
cpdxmm 63
cpymem 79
cpyupd 50

So some improvement, but still more testiing needed.

@edwardhartnett
Copy link
Contributor Author

edwardhartnett commented Jan 29, 2024

Here's the current testing levels for these functions:

Function Coverage
copybf 100
copymg 91.4
copysb 84.2
cpbfdx 100
cpdxmm 70
cpymem 79
cpyupd 93

Seems like there are some error conditions in cpymem() and cpdxmm() that could be tested. However, overall, what a great improvement.

@jbathegit
Copy link
Collaborator

Following the merging of some recent PRs, cpdxmm is now at 91% and cpymem is now at 97%. So I think we can close this one now.

@edwardhartnett
Copy link
Contributor Author

Nice!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
test Testing is important!
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants