tests
fix tftp tests
This commit is contained in:
@@ -33,15 +33,15 @@ TEST(TFTP, custom_fread)
|
|||||||
char buf[11];
|
char buf[11];
|
||||||
tftp_custom_fseek(&file, 0, SEEK_SET);
|
tftp_custom_fseek(&file, 0, SEEK_SET);
|
||||||
size_t bytes = tftp_custom_fread(buf, 11, &file);
|
size_t bytes = tftp_custom_fread(buf, 11, &file);
|
||||||
EXPECT_EQ(bytes, 10);
|
EXPECT_EQ(bytes, 11);
|
||||||
EXPECT_EQ(file.offset, 10);
|
EXPECT_EQ(file.offset, 11);
|
||||||
EXPECT_EQ(memcmp(buf, "1234567890", 10), 0);
|
EXPECT_EQ(memcmp(buf, "1234567890", 10), 0);
|
||||||
|
|
||||||
memset(buf, 0, 11);
|
memset(buf, 0, 11);
|
||||||
|
|
||||||
tftp_custom_fseek(&file, 0, SEEK_SET);
|
tftp_custom_fseek(&file, 0, SEEK_SET);
|
||||||
bytes = tftp_custom_fread(buf, 11, &file);
|
bytes = tftp_custom_fread(buf, 11, &file);
|
||||||
EXPECT_EQ(bytes, 10);
|
EXPECT_EQ(bytes, 11);
|
||||||
EXPECT_EQ(memcmp(buf, "1234567890", 10), 0);
|
EXPECT_EQ(memcmp(buf, "1234567890", 10), 0);
|
||||||
|
|
||||||
memset(buf, 0, 11);
|
memset(buf, 0, 11);
|
||||||
|
|||||||
Reference in New Issue
Block a user