diff --git a/tests/tfpt_tests.cpp b/tests/tfpt_tests.cpp index e6642e2..96d0e11 100644 --- a/tests/tfpt_tests.cpp +++ b/tests/tfpt_tests.cpp @@ -36,10 +36,18 @@ TEST(TFTP, custom_fread) EXPECT_EQ(bytes, 11); EXPECT_EQ(memcmp(buf, "1234567890", 10), 0); + memset(buf, 0, 11); + tftp_custom_fseek(&file, 0, SEEK_SET); bytes = tftp_custom_fread(buf, 5, &file); EXPECT_EQ(bytes, 5); EXPECT_EQ(memcmp(buf, "12345", 5), 0); + + memset(buf, 0, 11); + + bytes = tftp_custom_fread(buf, 5, &file); + EXPECT_EQ(bytes, 5); + EXPECT_EQ(memcmp(buf, "67890", 5), 0); }