Skip to content

Commit cf5709f

Browse files
committed
Adapting to latest Anyness changes
1 parent 523e681 commit cf5709f

File tree

5 files changed

+26
-26
lines changed

5 files changed

+26
-26
lines changed

source/Code.cpp

+2
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
#include "verbs/Catenate.inl"
1818
#include "verbs/Conjunct.inl"
1919
#include "verbs/Interpret.inl"
20+
#include "verbs/Compare.inl"
2021

2122
LANGULUS_RTTI_BOUNDARY(RTTI::MainBoundary)
2223

@@ -89,6 +90,7 @@ namespace Langulus::Flow
8990
(void)MetaOf<Verbs::Catenate>();
9091
(void)MetaOf<Verbs::Conjunct>();
9192
(void)MetaOf<Verbs::Interpret>();
93+
(void)MetaOf<Verbs::Compare>();
9294

9395
// Parse
9496
Many output;

source/Resolvable.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ namespace Langulus::Flow
5555
/// @return the static memory block representing this instance
5656
Block<> Resolvable::GetBlock() const noexcept {
5757
return {
58-
DataState::Static, mClassType, 1,
58+
DataState::Default, mClassType, 1,
5959
const_cast<void*>(mClassPointer)
6060
};
6161
}

source/inner/Missing.cpp

+2-2
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,7 @@ bool Missing::Push(const Many& content) {
132132
// Let's check if there's a filter
133133
if (not mFilter) {
134134
// No filter, just push
135-
if (not content.template CastsTo<Verb, true>()) {
135+
/*if (not content.template CastsTo<Verb, true>()) {
136136
// Always try interpreting scope as verbs
137137
Verbs::InterpretAs<Verb> interpreter;
138138
interpreter.ShortCircuit(false);
@@ -144,7 +144,7 @@ bool Missing::Push(const Many& content) {
144144
interpreter.GetOutput(), NoPriority);
145145
return Push(compiled);
146146
}
147-
}
147+
}*/
148148

149149
// Scope is either verbs or something else, just push
150150
Many linked;

source/verbs/Do.inl

+1-1
Original file line numberDiff line numberDiff line change
@@ -240,7 +240,7 @@ namespace Langulus::Flow
240240
// Iterate elements in the current context
241241
for (Count i = 0; i < context.GetCount(); ++i) {
242242
//verb.SetSource(context.GetElement(i));
243-
Many ith = context.GetElement(i);
243+
auto ith = context.GetElement(i);
244244
if constexpr (RESOLVE)
245245
ith = ith.GetResolved();
246246
else

test/TestFactory.cpp

+20-22
Original file line numberDiff line numberDiff line change
@@ -19,13 +19,11 @@ SCENARIO("Test factories", "[factory]") {
1919
GIVEN("A factory with default usage") {
2020
TFactory<Producible> factory;
2121

22-
WHEN("Default-constructed") {
23-
REQUIRE(factory.IsUnique == false);
24-
REQUIRE(factory.GetReusable() == nullptr);
25-
REQUIRE(not factory.GetHashmap());
26-
REQUIRE(factory.IsEmpty());
27-
REQUIRE(factory.GetType() == MetaOf<Producible>());
28-
}
22+
REQUIRE(factory.IsUnique == false);
23+
REQUIRE(factory.GetReusable() == nullptr);
24+
REQUIRE(not factory.GetHashmap());
25+
REQUIRE(factory.IsEmpty());
26+
REQUIRE(factory.GetType() == MetaOf<Producible>());
2927

3028
WHEN("Two default elements produced") {
3129
const auto descriptor = Construct::From<Producible>();
@@ -39,7 +37,7 @@ SCENARIO("Test factories", "[factory]") {
3937
REQUIRE(creator.IsDone());
4038
REQUIRE(out1.GetCount() == 1);
4139
REQUIRE(out1.IsExact<Producible*>());
42-
REQUIRE(out1.As<Producible*>()->Reference(0) == 2);
40+
REQUIRE(out1.As<Producible*>()->Reference(0) == 3);
4341
REQUIRE(out1.IsSparse());
4442

4543
creator.Undo();
@@ -49,7 +47,7 @@ SCENARIO("Test factories", "[factory]") {
4947
auto out2 = creator.GetOutput();
5048
REQUIRE(out2.GetCount() == 1);
5149
REQUIRE(out2.IsExact<Producible*>());
52-
REQUIRE(out2.As<Producible*>()->Reference(0) == 2);
50+
REQUIRE(out2.As<Producible*>()->Reference(0) == 3);
5351
REQUIRE(out2.IsSparse());
5452

5553
REQUIRE(factory.GetReusable() == factory.GetFrames()[0].GetRaw() + 2);
@@ -75,13 +73,11 @@ SCENARIO("Test factories", "[factory]") {
7573
GIVEN("A factory with unique usage") {
7674
TFactoryUnique<Producible> factory;
7775

78-
WHEN("Default-constructed") {
79-
REQUIRE(factory.IsUnique == true);
80-
REQUIRE(factory.GetReusable() == nullptr);
81-
REQUIRE(not factory.GetHashmap());
82-
REQUIRE(factory.IsEmpty());
83-
REQUIRE(factory.GetType() == MetaOf<Producible>());
84-
}
76+
REQUIRE(factory.IsUnique == true);
77+
REQUIRE(factory.GetReusable() == nullptr);
78+
REQUIRE(not factory.GetHashmap());
79+
REQUIRE(factory.IsEmpty());
80+
REQUIRE(factory.GetType() == MetaOf<Producible>());
8581

8682
WHEN("Two default elements produced") {
8783
const auto descriptor = Construct::From<Producible>();
@@ -100,7 +96,7 @@ SCENARIO("Test factories", "[factory]") {
10096
REQUIRE(creator.IsDone());
10197
REQUIRE(out1.GetCount() == 1);
10298
REQUIRE(out1.IsExact<Producible*>());
103-
REQUIRE(out1.As<Producible*>()->Reference(0) == 3);
99+
REQUIRE(out1.As<Producible*>()->Reference(0) == 4);
104100
REQUIRE(out1.IsSparse());
105101
REQUIRE(out1 == out2);
106102

@@ -117,24 +113,26 @@ SCENARIO("Test factories", "[factory]") {
117113

118114
prototype.Reference(-1);
119115
}
120-
116+
121117
WHEN("Two elements produced via descriptors") {
122118
TMany<Producer> context;
123119
context.New(1);
124120

125121
const auto descriptor = Construct::From<Producible>(
126-
Traits::Parent(&context[0]));
122+
Traits::Parent(&context[0]),
123+
"test"_text
124+
);
127125
Verbs::Create creator {&descriptor};
128126
const Producible prototype {&producer, descriptor.GetDescriptor()};
129127

130128
factory.Create(&producer, creator);
131129
auto out1 = creator.GetOutput();
132-
REQUIRE(out1.As<Producible*>()->Reference(0) == 2);
130+
REQUIRE(out1.As<Producible*>()->Reference(0) == 3);
133131

134132
creator.Undo();
135133
factory.Create(&producer, creator);
136134
auto out2 = creator.GetOutput();
137-
REQUIRE(out2.As<Producible*>()->Reference(0) == 3);
135+
REQUIRE(out2.As<Producible*>()->Reference(0) == 4);
138136

139137
// Parent traits shouldn't participate in hashing
140138
const auto hash = descriptor.GetDescriptor().GetHash();
@@ -144,7 +142,7 @@ SCENARIO("Test factories", "[factory]") {
144142
REQUIRE(creator.IsDone());
145143
REQUIRE(out1.GetCount() == 1);
146144
REQUIRE(out1.IsExact<Producible*>());
147-
REQUIRE(out1.As<Producible*>()->Reference(0) == 3);
145+
REQUIRE(out1.As<Producible*>()->Reference(0) == 4);
148146
REQUIRE(out1.IsSparse());
149147
REQUIRE(out1 == out2);
150148

0 commit comments

Comments
 (0)