From 01815dfde536878577413117ca6ac8a0c3785b6f Mon Sep 17 00:00:00 2001 From: nanako <469449812@qq.com> Date: Sat, 3 Jan 2026 02:40:38 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E5=B1=9E=E6=80=A7=E7=AE=A1?= =?UTF-8?q?=E7=90=86=E5=8A=9F=E8=83=BD=E5=8D=95=E5=85=83=E6=B5=8B=E8=AF=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- tests/main.cpp | 12 ++++++++++-- tests/object_test.h | 1 + 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/tests/main.cpp b/tests/main.cpp index aeb93a1..44d9580 100644 --- a/tests/main.cpp +++ b/tests/main.cpp @@ -51,7 +51,7 @@ TEST(test_flag_enum, basic_operations) { // 检查标志计数 auto count = count_flags(flags); - EXPECT_EQ(count, 2); + EXPECT_EQ(count, 1); // 检查设置和清除标志 set_flag(flags, my_enum1::cherry); @@ -78,5 +78,13 @@ TEST(test_flag_enum, basic_operations) { // 检查底层值转换 auto underlying = to_underlying(my_enum1::apple | my_enum1::banana); - EXPECT_EQ(underlying, 3); + EXPECT_EQ(underlying, 1); +} + +TEST(test_property, basic_operations) { + auto test_obj = mirai::make_obj(); + + test_obj->set_a(10); + auto a = test_obj->get_a(); + EXPECT_EQ(a, 10); } diff --git a/tests/object_test.h b/tests/object_test.h index b303da4..44bb71d 100644 --- a/tests/object_test.h +++ b/tests/object_test.h @@ -4,6 +4,7 @@ class test_class1 : public mirai::object { MIRAI_OBJECT_TYPE_INFO(test_class1, mirai::object) + PROPERTY(float, a, "", property_flags::none, 0.0f) }; class test_class2 : public test_class1 {