D
darren kirby
Hello all,
As my flac library approaches 1000 lines of code I decided it would be prudent
to finally get around to writing some unit tests, which I have done. Now: I
have created a 'reference' flac file with known values, which I then read to
see if my lib parses it correctly.
That works great for the 'read' part of the library, however, I am now adding
methods which write/rewrite values in the flac file (tags, padding blocks
etc) making permanent changes in the file, and I am wondering how best to
write tests for these.
I am thinking that I need to write code which makes a copy of the reference
file, write the changes, read the copy to ensure the changes were written
correctly, then delete the copy.
Does this seem reasonable? Is there a better way?
Thanks for consideration,
-d
As my flac library approaches 1000 lines of code I decided it would be prudent
to finally get around to writing some unit tests, which I have done. Now: I
have created a 'reference' flac file with known values, which I then read to
see if my lib parses it correctly.
That works great for the 'read' part of the library, however, I am now adding
methods which write/rewrite values in the flac file (tags, padding blocks
etc) making permanent changes in the file, and I am wondering how best to
write tests for these.
I am thinking that I need to write code which makes a copy of the reference
file, write the changes, read the copy to ensure the changes were written
correctly, then delete the copy.
Does this seem reasonable? Is there a better way?
Thanks for consideration,
-d