1 Star 0 Fork 209

mrchehq/pikapython

forked from 李昂/pikapython 
加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
packtool-test.cpp 895 Bytes
一键复制 编辑 原始数据 按行查看 历史
sjy 提交于 2023-03-08 15:16 . add gtest cpp file: packtool-test.cpp
#include "test_common.h"
TEST_START
#include "PikaCompiler.h"
TEST(packtool, unpack) {
PIKA_RES res = LibObj_unpackFileToPath("test/assets/a.pack", "test/out/unpackout");
EXPECT_EQ(res, PIKA_RES_OK);
}
TEST(packtool, packread) {
size_t n = 0;
//Arg* fileArg = NULL;
pikafs_FILE* pack_file = pikafs_fopen_pack("test/assets/a.pack", "main.py");
// pikafs_FILE* pack_file = pikafs_fopen_pack_new(&fileArg, "test/assets/a.pack", "main.py");
FILE* file = pika_platform_fopen("test/out/unpackout/main2.py", "wb+");
if (NULL == file) {
pika_platform_printf("open file: %s error\r\n", "test/out/unpackout/main2.py");
}
n = pika_platform_fwrite(pack_file->addr, pack_file->size, 1, file);
EXPECT_NE(n, 0);
//arg_deinit(fileArg);
pikaFree(pack_file, sizeof(pikafs_FILE));
pika_platform_fclose(file);
pack_file = NULL;
}
TEST_END
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
C
1
https://gitee.com/mrchehq/pikapython.git
[email protected]:mrchehq/pikapython.git
mrchehq
pikapython
pikapython
master

搜索帮助