Debian Codegraph @

tests/StrengthTest.cpp

raw
1 /*-----------------------------------------------------------------------------
2 | Copyright (c) 2013-2026, Nucleic Development Team.
3 |
4 | Distributed under the terms of the Modified BSD License.
5 |
6 | The full license is in the file LICENSE, distributed with this software.
7 |----------------------------------------------------------------------------*/
8
9 #include <gtest/gtest.h>
10 #include <kiwi/kiwi.h>
11
12 using namespace kiwi;
13
14 // Test accessing predefined strengths
15 TEST(StrengthTest, AccessingPredefinedStrength) {
16 EXPECT_LT(strength::weak, strength::medium);
17 EXPECT_LT(strength::medium, strength::strong);
18 EXPECT_LT(strength::strong, strength::required);
19 }
20
21 // Test creating strength from constituent values
22 TEST(StrengthTest, CreatingStrength) {
23 EXPECT_LT(strength::create(0, 0, 1), strength::create(0, 1, 0));
24 EXPECT_LT(strength::create(0, 1, 0), strength::create(1, 0, 0));
25 EXPECT_LT(strength::create(1, 0, 0, 1), strength::create(1, 0, 0, 4));
26 }