-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
8f3e414
commit 1d798ef
Showing
2 changed files
with
42 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
// Copyright (C) 2024 Albin Johansson (GNU General Public License v3.0) | ||
|
||
#include "tactile/core/meta/meta.hpp" | ||
|
||
#include <gmock/gmock.h> | ||
#include <gtest/gtest.h> | ||
|
||
#include "tactile/base/test_util/ir_presets.hpp" | ||
#include "tactile/core/entity/registry.hpp" | ||
#include "tactile/core/test/ir_comparison.hpp" | ||
|
||
namespace tactile::test { | ||
|
||
// tactile::is_meta | ||
TEST(Meta, IsMeta) | ||
{ | ||
Registry registry {}; | ||
|
||
const auto meta_id = registry.make_entity(); | ||
registry.add<CMeta>(meta_id); | ||
|
||
EXPECT_FALSE(is_meta(registry, kInvalidEntity)); | ||
EXPECT_FALSE(is_meta(registry, registry.make_entity())); | ||
EXPECT_TRUE(is_meta(registry, meta_id)); | ||
} | ||
|
||
// tactile::convert_ir_metadata | ||
TEST(Meta, ConvertIrMetadata) | ||
{ | ||
Registry registry {}; | ||
|
||
const auto meta_id = registry.make_entity(); | ||
registry.add<CMeta>(meta_id); | ||
|
||
const auto ir_metadata = make_complex_ir_metadata("Meta"); | ||
convert_ir_metadata(registry, meta_id, ir_metadata); | ||
|
||
compare_meta(registry, meta_id, ir_metadata); | ||
} | ||
|
||
} // namespace tactile::test |