To test my sprintf code I wrote a loop that took a buffer of unsigned integer hexadecimal data and looped through it and sent each value to a testing function as an integer decimal value. That way if I needed this test to be included anywhere else in the project, it would be portable enough and could be with one single line of code. To create this test I created a C module using an includable header file. This match would validate that my solution was correct and allow me to continue on with my project with tested code. One way I thought to do this was to manually create an algorithm that converted the decimal form of the hex data into ASCII data so I could then compare the output from sprintf to my hand converted text to see if I had a match. To test my solution of using sprintf, I needed a way to validate that the output I was getting from sprintf was accurate.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |