[AMDGPU][AsmParser][NFC] Translate parsed MIMG instructions to MCInsts automatically.
[llvm-project.git] / clang-tools-extra / clangd / unittests / DecisionForestTests.cpp
blobd29c8a4a0358f2aeb2f95fad887d88d89483a659
1 #include "DecisionForestRuntimeTest.h"
2 #include "decision_forest_model/CategoricalFeature.h"
3 #include "gtest/gtest.h"
5 namespace clang {
6 namespace clangd {
8 TEST(DecisionForestRuntime, Evaluate) {
9 using Example = ::ns1::ns2::test::Example;
10 using Cat = ::ns1::ns2::TestEnum;
11 using ::ns1::ns2::test::Evaluate;
13 Example E;
14 E.setANumber(200); // True
15 E.setAFloat(0); // True: +10.0
16 E.setACategorical(Cat::A); // True: +5.0
17 EXPECT_EQ(Evaluate(E), 15.0);
19 E.setANumber(200); // True
20 E.setAFloat(-2.5); // False: -20.0
21 E.setACategorical(Cat::B); // True: +5.0
22 EXPECT_EQ(Evaluate(E), -15.0);
24 E.setANumber(100); // False
25 E.setACategorical(Cat::C); // True: +3.0, False: -6.0
26 EXPECT_EQ(Evaluate(E), -3.0);
28 } // namespace clangd
29 } // namespace clang