awtk/tests/enums_test.cc

19 lines
763 B
C++
Raw Normal View History

2019-05-22 17:13:00 +08:00
#include "base/keys.h"
#include "base/enums.h"
2018-03-09 21:54:46 +08:00
#include "gtest/gtest.h"
2018-08-24 07:45:37 +08:00
#include "base/assets_manager.h"
2018-03-09 21:54:46 +08:00
TEST(Enums, basic) {
2018-08-24 07:45:37 +08:00
ASSERT_EQ(asset_type_find("style"), asset_type_find_by_value(ASSET_TYPE_STYLE));
ASSERT_EQ(asset_type_find("xml"), asset_type_find_by_value(ASSET_TYPE_XML));
2018-03-09 21:54:46 +08:00
}
TEST(Enums, keys) {
ASSERT_EQ(keys_type_find("a"), keys_type_find_by_value(TK_KEY_a));
ASSERT_EQ(keys_type_find("A"), keys_type_find_by_value(TK_KEY_A));
ASSERT_EQ(keys_type_find("LEFT"), keys_type_find_by_value(TK_KEY_LEFT));
ASSERT_EQ(keys_type_find("left"), keys_type_find_by_value(TK_KEY_LEFT));
ASSERT_EQ(keys_type_find("RETURN"), keys_type_find_by_value(TK_KEY_RETURN));
ASSERT_EQ(keys_type_find("return"), keys_type_find_by_value(TK_KEY_RETURN));
}