mirror of
https://gitee.com/Lyon1998/pikapython.git
synced 2025-01-15 17:02:53 +08:00
add test for bytes 0 size
This commit is contained in:
parent
dd5b8ec985
commit
925e773200
@ -1,3 +1,4 @@
|
||||
#!/bin/sh
|
||||
FLAG_OK="\033[32m[ OK ]\033[0m"
|
||||
FLAG_INFO="\033[32m[Info]\033[0m"
|
||||
FLAG_NOTE="\033[35m[Note]\033[0m"
|
||||
@ -13,7 +14,7 @@ pkg=$1
|
||||
|
||||
# Check if the package exists
|
||||
if [ ! -d package/pikascript/pikascript-lib/$pkg ] ; then
|
||||
echo -e "$FLAG_ERROR Package $pkg does not exist"
|
||||
echo "$FLAG_ERROR Package $pkg does not exist"
|
||||
exit 1;
|
||||
fi
|
||||
|
||||
@ -23,7 +24,7 @@ git add package/pikascript/pikascript-lib/$pkg
|
||||
|
||||
# check if $pkg.pyi is exit
|
||||
if [ -f "package/pikascript/$pkg.pyi" ] ; then
|
||||
echo -e "$FLAG_INFO python interface files added"
|
||||
echo "$FLAG_INFO python interface files added"
|
||||
cp package/pikascript/$pkg.pyi ../../package/$pkg/
|
||||
git add package/pikascript/$pkg.pyi
|
||||
echo "$pkg.pyi"
|
||||
@ -31,7 +32,7 @@ fi
|
||||
|
||||
# check if $pkg.py is exit
|
||||
if [ -f "package/pikascript/$pkg.py" ] ; then
|
||||
echo -e "$FLAG_INFO python files added"
|
||||
echo "$FLAG_INFO python files added"
|
||||
rm -rf ../../package/$pkg/*
|
||||
cp package/pikascript/$pkg.py ../../package/$pkg/
|
||||
git add package/pikascript/$pkg.py
|
||||
@ -40,7 +41,7 @@ fi
|
||||
|
||||
# check if test/python/$pkg folder is exit
|
||||
if [ -d "test/python/$pkg" ] ; then
|
||||
echo -e "$FLAG_INFO python test files added:"
|
||||
echo "$FLAG_INFO python test files added:"
|
||||
rm ../../examples/$pkg/* -rf
|
||||
cp test/python/$pkg/*.py ../../examples/$pkg -r
|
||||
git add ../../examples/$pkg
|
||||
@ -48,9 +49,9 @@ ls ../../examples/$pkg
|
||||
fi
|
||||
|
||||
git add ../../package/$pkg
|
||||
echo -e "$FLAG_INFO lib files added:"
|
||||
echo "$FLAG_INFO lib files added:"
|
||||
# list files name in package/pikascript/pikascript-lib/$pkg
|
||||
ls package/pikascript/pikascript-lib/$pkg
|
||||
echo -e "$FLAG_OK Push \033[32m$pkg\033[0m to ../../package/$pkg successfully!"
|
||||
echo -e "$FLAG_NOTE Now, you can run 'git commit -a' to commit changes."
|
||||
echo -e "$FLAG_NOTE Then, you can run 'git push' to push to github/gitee."
|
||||
echo "$FLAG_OK Push \033[32m$pkg\033[0m to ../../package/$pkg successfully!"
|
||||
echo "$FLAG_NOTE Now, you can run 'git commit -a' to commit changes."
|
||||
echo "$FLAG_NOTE Then, you can run 'git push' to push to github/gitee."
|
||||
|
@ -1,3 +1,4 @@
|
||||
#!/bin/sh
|
||||
FLAG_OK="\033[32m[ OK ]\033[0m"
|
||||
FLAG_INFO="\033[32m[Info]\033[0m"
|
||||
FLAG_NOTE="\033[35m[Note]\033[0m"
|
||||
@ -9,7 +10,7 @@ sh std_push.sh PikaStdLib
|
||||
sh std_push.sh PikaStdData
|
||||
sh std_push.sh PikaDebug
|
||||
sh std_push.sh PikaStdTask
|
||||
echo -e "$FLAG_OK Push \033[32mpikascript-core\033[0m to ../../src successfully!"
|
||||
echo -e "$FLAG_OK Push \033[32mPikaSdLib\033[0m to ../../package/PikaStdLib successfully!"
|
||||
echo -e "$FLAG_NOTE Now, you can run 'git commit -a' to commit changes."
|
||||
echo -e "$FLAG_NOTE Then, you can run 'git push' to push to github/gitee."
|
||||
echo "$FLAG_OK Push \033[32mpikascript-core\033[0m to ../../src successfully!"
|
||||
echo "$FLAG_OK Push \033[32mPikaSdLib\033[0m to ../../package/PikaStdLib successfully!"
|
||||
echo "$FLAG_NOTE Now, you can run 'git commit -a' to commit changes."
|
||||
echo "$FLAG_NOTE Then, you can run 'git push' to push to github/gitee."
|
@ -253,3 +253,11 @@ TEST(object_test, bytes) {
|
||||
obj_deinit(root);
|
||||
EXPECT_EQ(pikaMemNow(), 0);
|
||||
}
|
||||
|
||||
TEST(object_test, bytes_0_size) {
|
||||
PikaObj* root = newRootObj("root", New_BaseObj);
|
||||
uint8_t test[] = {0, 1, 2, 3, 4, 5};
|
||||
obj_setBytes(root, "test", test, 0);
|
||||
obj_deinit(root);
|
||||
EXPECT_EQ(pikaMemNow(), 0);
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user