mirror of
https://gitee.com/Lyon1998/pikapython.git
synced 2025-01-15 17:02:53 +08:00
38388625ca
change project name and url on kernal sources rename global Value format name use g_PikaObjState add gc chain add gc_mark() add printCanFree add sub locals init try use mark-sweep to solve circle-ref use mark sweep to collect circle ref succeed import mark-sweep GC config_default update
172 lines
4.2 KiB
C
172 lines
4.2 KiB
C
#include "test_common.h"
|
|
TEST_START
|
|
|
|
#if (PIKA_SYNTAX_LEVEL == PIKA_SYNTAX_LEVEL_MAXIMAL) && (!PIKA_POOL_ENABLE)
|
|
TEST(PikaCV, test1) {
|
|
/* init */
|
|
g_pikaMemInfo.heapUsedMax = 0;
|
|
PikaObj* pikaMain = newRootObj("pikaMain", New_PikaMain);
|
|
/* run */
|
|
__platform_printf("BEGIN\r\n");
|
|
pikaVM_runSingleFile(pikaMain, "test/python/PikaCV/PikaCV_test1.py");
|
|
/* collect */
|
|
/* assert */
|
|
/* deinit */
|
|
obj_deinit(pikaMain);
|
|
|
|
EXPECT_EQ(pikaMemNow(), 0);
|
|
}
|
|
|
|
TEST(PikaCV, test2) {
|
|
/* init */
|
|
g_pikaMemInfo.heapUsedMax = 0;
|
|
PikaObj* pikaMain = newRootObj("pikaMain", New_PikaMain);
|
|
/* run */
|
|
__platform_printf("BEGIN\r\n");
|
|
pikaVM_runSingleFile(pikaMain, "test/python/PikaCV/PikaCV_test2.py");
|
|
/* collect */
|
|
/* assert */
|
|
/* deinit */
|
|
obj_deinit(pikaMain);
|
|
|
|
EXPECT_EQ(pikaMemNow(), 0);
|
|
}
|
|
|
|
TEST(PikaCV, test3) {
|
|
/* init */
|
|
g_pikaMemInfo.heapUsedMax = 0;
|
|
PikaObj* pikaMain = newRootObj("pikaMain", New_PikaMain);
|
|
/* run */
|
|
__platform_printf("BEGIN\r\n");
|
|
pikaVM_runSingleFile(pikaMain, "test/python/PikaCV/PikaCV_test3.py");
|
|
/* collect */
|
|
/* assert */
|
|
/* deinit */
|
|
obj_deinit(pikaMain);
|
|
|
|
EXPECT_EQ(pikaMemNow(), 0);
|
|
}
|
|
|
|
TEST(PikaCV, test4) {
|
|
/* init */
|
|
g_pikaMemInfo.heapUsedMax = 0;
|
|
PikaObj* pikaMain = newRootObj("pikaMain", New_PikaMain);
|
|
/* run */
|
|
__platform_printf("BEGIN\r\n");
|
|
pikaVM_runSingleFile(pikaMain, "test/python/PikaCV/PikaCV_test4.py");
|
|
/* collect */
|
|
/* assert */
|
|
/* deinit */
|
|
obj_deinit(pikaMain);
|
|
|
|
EXPECT_EQ(pikaMemNow(), 0);
|
|
}
|
|
|
|
TEST(PikaCV, test5) {
|
|
/* init */
|
|
g_pikaMemInfo.heapUsedMax = 0;
|
|
PikaObj* pikaMain = newRootObj("pikaMain", New_PikaMain);
|
|
/* run */
|
|
__platform_printf("BEGIN\r\n");
|
|
pikaVM_runSingleFile(pikaMain, "test/python/PikaCV/PikaCV_test5.py");
|
|
/* collect */
|
|
/* assert */
|
|
/* deinit */
|
|
obj_deinit(pikaMain);
|
|
|
|
EXPECT_EQ(pikaMemNow(), 0);
|
|
}
|
|
|
|
TEST(PikaCV, test6) {
|
|
/* init */
|
|
g_pikaMemInfo.heapUsedMax = 0;
|
|
PikaObj* pikaMain = newRootObj("pikaMain", New_PikaMain);
|
|
/* run */
|
|
__platform_printf("BEGIN\r\n");
|
|
pikaVM_runSingleFile(pikaMain, "test/python/PikaCV/PikaCV_test6.py");
|
|
/* collect */
|
|
/* assert */
|
|
/* deinit */
|
|
obj_deinit(pikaMain);
|
|
|
|
EXPECT_EQ(pikaMemNow(), 0);
|
|
}
|
|
|
|
TEST(PikaCV, test7) {
|
|
/* init */
|
|
g_pikaMemInfo.heapUsedMax = 0;
|
|
PikaObj* pikaMain = newRootObj("pikaMain", New_PikaMain);
|
|
/* run */
|
|
__platform_printf("BEGIN\r\n");
|
|
pikaVM_runSingleFile(pikaMain, "test/python/PikaCV/PikaCV_test7.py");
|
|
/* collect */
|
|
/* assert */
|
|
/* deinit */
|
|
obj_deinit(pikaMain);
|
|
|
|
EXPECT_EQ(pikaMemNow(), 0);
|
|
}
|
|
|
|
TEST(PikaCV, test8) {
|
|
/* init */
|
|
g_pikaMemInfo.heapUsedMax = 0;
|
|
PikaObj* pikaMain = newRootObj("pikaMain", New_PikaMain);
|
|
/* run */
|
|
__platform_printf("BEGIN\r\n");
|
|
pikaVM_runSingleFile(pikaMain, "test/python/PikaCV/PikaCV_test8.py");
|
|
/* collect */
|
|
/* assert */
|
|
/* deinit */
|
|
obj_deinit(pikaMain);
|
|
|
|
EXPECT_EQ(pikaMemNow(), 0);
|
|
}
|
|
|
|
TEST(PikaCV, test9) {
|
|
/* init */
|
|
g_pikaMemInfo.heapUsedMax = 0;
|
|
PikaObj* pikaMain = newRootObj("pikaMain", New_PikaMain);
|
|
/* run */
|
|
__platform_printf("BEGIN\r\n");
|
|
pikaVM_runSingleFile(pikaMain, "test/python/PikaCV/PikaCV_test9.py");
|
|
/* collect */
|
|
/* assert */
|
|
/* deinit */
|
|
obj_deinit(pikaMain);
|
|
|
|
EXPECT_EQ(pikaMemNow(), 0);
|
|
}
|
|
|
|
TEST(PikaCV, test10) {
|
|
/* init */
|
|
g_pikaMemInfo.heapUsedMax = 0;
|
|
PikaObj* pikaMain = newRootObj("pikaMain", New_PikaMain);
|
|
/* run */
|
|
__platform_printf("BEGIN\r\n");
|
|
pikaVM_runSingleFile(pikaMain, "test/python/PikaCV/PikaCV_test10.py");
|
|
/* collect */
|
|
/* assert */
|
|
/* deinit */
|
|
obj_deinit(pikaMain);
|
|
|
|
EXPECT_EQ(pikaMemNow(), 0);
|
|
}
|
|
|
|
TEST(PikaCV, test11) {
|
|
/* init */
|
|
g_pikaMemInfo.heapUsedMax = 0;
|
|
PikaObj* pikaMain = newRootObj("pikaMain", New_PikaMain);
|
|
/* run */
|
|
__platform_printf("BEGIN\r\n");
|
|
pikaVM_runSingleFile(pikaMain, "test/python/PikaCV/PikaCV_test11.py");
|
|
/* collect */
|
|
// Arg* data = obj_getArg(pikaMain, "data");
|
|
/* assert */
|
|
/* deinit */
|
|
obj_deinit(pikaMain);
|
|
|
|
EXPECT_EQ(pikaMemNow(), 0);
|
|
}
|
|
#endif
|
|
|
|
TEST_END |