awtk/tests/rom_fs_test.cc

12 lines
309 B
C++
Raw Normal View History

2019-08-19 17:44:03 +08:00
#include "tkc/rom_fs.h"
2018-06-24 12:23:51 +08:00
#include "gtest/gtest.h"
TEST(ROMFS, basic) {
char rbuff[100];
const char* buff = "hello world";
2018-06-24 18:03:28 +08:00
rom_file_t* f = rom_fopen_buff((const uint8_t*)buff, sizeof(buff));
2021-09-16 16:06:55 +08:00
ASSERT_EQ(rom_fread(rbuff, 2, 1, f), (size_t)1);
2018-06-24 12:23:51 +08:00
ASSERT_EQ(memcmp(rbuff, "he", 2), 0);
rom_fclose(f);
}