add test for block assert

This commit is contained in:
lyon 2021-09-04 16:59:05 +08:00
parent bbe6845cde
commit 0cadf57c9a

View File

@ -39,9 +39,17 @@ TEST(block, pop)
TEST(block, assert1)
{
PikaObj *block = block_init();
block_setAssert(block, (char *)"1");
int res = block_checkAssert(block);
ASSERT_EQ(1, res);
{
block_setAssert(block, (char *)"1");
int res = block_checkAssert(block);
ASSERT_EQ(1, res);
}
{
block_setAssert(block, (char *)"0");
int res = block_checkAssert(block);
ASSERT_EQ(0, res);
}
block_deinit(block);
}