Skip to content

Commit 5c80dba

Browse files
Fixed chaotic tests
1 parent f3cad89 commit 5c80dba

File tree

4 files changed

+20
-20
lines changed

4 files changed

+20
-20
lines changed

chaotic/integration_tests/tests/lib/array.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ TEST(Array, OfIntWithValidators) {
3838

3939
const auto kJson1 = formats::json::MakeArray("foo");
4040
UEXPECT_THROW_MSG(
41-
kJson1.As<Arr>(), chaotic::Error<userver::formats::json::Value>, "Error at path '/': Too short array, minimum length=2, given=1"
41+
kJson1.As<Arr>(), chaotic::Error<formats::json::Value>, "Error at path '/': Too short array, minimum length=2, given=1"
4242
);
4343
}
4444

chaotic/integration_tests/tests/lib/primitive.cpp

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -69,9 +69,9 @@ TEST(Primitive, IntMinMax) {
6969
int x = kJson["foo"].As<Int>();
7070
EXPECT_EQ(x, 1);
7171

72-
UEXPECT_THROW_MSG(kJson["bar"].As<Int>(), chaotic::Error<userver::formats::json::Value>,
72+
UEXPECT_THROW_MSG(kJson["bar"].As<Int>(), chaotic::Error<formats::json::Value>,
7373
"Error at path 'bar': Invalid value, minimum=1, given=0");
74-
UEXPECT_THROW_MSG(kJson["zoo"].As<Int>(), chaotic::Error<userver::formats::json::Value>,
74+
UEXPECT_THROW_MSG(kJson["zoo"].As<Int>(), chaotic::Error<formats::json::Value>,
7575
"Error at path 'zoo': Invalid value, maximum=5, given=6");
7676
}
7777

@@ -82,9 +82,9 @@ TEST(Primitive, UserTypeMinMax) {
8282
MyInt x = kJson["foo"].As<Int>();
8383
EXPECT_EQ(x.value, 1);
8484

85-
UEXPECT_THROW_MSG(kJson["bar"].As<Int>(), chaotic::Error<userver::formats::json::Value>,
85+
UEXPECT_THROW_MSG(kJson["bar"].As<Int>(), chaotic::Error<formats::json::Value>,
8686
"Error at path 'bar': Invalid value, minimum=1, given=0");
87-
UEXPECT_THROW_MSG(kJson["zoo"].As<Int>(), chaotic::Error<userver::formats::json::Value>,
87+
UEXPECT_THROW_MSG(kJson["zoo"].As<Int>(), chaotic::Error<formats::json::Value>,
8888
"Error at path 'zoo': Invalid value, maximum=5, given=6");
8989
}
9090

@@ -97,11 +97,11 @@ TEST(Primitive, StringMinMaxLength) {
9797
EXPECT_EQ(x, "12");
9898

9999
UEXPECT_THROW_MSG(
100-
kLocalJson["1"].As<Str>(), chaotic::Error<userver::formats::json::Value>,
100+
kLocalJson["1"].As<Str>(), chaotic::Error<formats::json::Value>,
101101
"Error at path '1': Too short string, minimum length=2, given=1"
102102
);
103103
UEXPECT_THROW_MSG(
104-
kLocalJson["6"].As<Str>(), chaotic::Error<userver::formats::json::Value>,
104+
kLocalJson["6"].As<Str>(), chaotic::Error<formats::json::Value>,
105105
"Error at path '6': Too long string, maximum length=5, given=6"
106106
);
107107
}
@@ -116,7 +116,7 @@ TEST(Primitive, StringPattern) {
116116
std::string x = kLocalJson["1"].As<Str>();
117117
EXPECT_EQ(x, "foo");
118118

119-
UEXPECT_THROW_MSG(kLocalJson["2"].As<Str>(), chaotic::Error<userver::formats::json::Value>, "doesn't match regex");
119+
UEXPECT_THROW_MSG(kLocalJson["2"].As<Str>(), chaotic::Error<formats::json::Value>, "doesn't match regex");
120120
}
121121

122122
USERVER_NAMESPACE_END

chaotic/integration_tests/tests/render/minmax.cpp

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ USERVER_NAMESPACE_BEGIN
1010
TEST(MinMax, ExclusiveInt) {
1111
auto json = formats::json::MakeObject("foo", 1);
1212
UEXPECT_THROW_MSG(
13-
json.As<ns::IntegerObject>(), chaotic::Error<userver::formats::json::Value>,
13+
json.As<ns::IntegerObject>(), chaotic::Error<formats::json::Value>,
1414
"Error at path 'foo': Invalid value, exclusive minimum=1, given=1"
1515
);
1616

@@ -20,7 +20,7 @@ TEST(MinMax, ExclusiveInt) {
2020
json = formats::json::MakeObject("foo", 20);
2121
UEXPECT_THROW_MSG(
2222
json.As<ns::IntegerObject>(),
23-
chaotic::Error<userver::formats::json::Value>,
23+
chaotic::Error<formats::json::Value>,
2424
"Error at path 'foo': Invalid value, exclusive maximum=20, given=20"
2525
);
2626

@@ -31,27 +31,27 @@ TEST(MinMax, ExclusiveInt) {
3131
TEST(MinMax, String) {
3232
auto json = formats::json::MakeObject("bar", "");
3333
UEXPECT_THROW_MSG(
34-
json.As<ns::IntegerObject>(), chaotic::Error<userver::formats::json::Value>,
34+
json.As<ns::IntegerObject>(), chaotic::Error<formats::json::Value>,
3535
"Error at path 'bar': Too short string, minimum length=2, given=0"
3636
);
3737

3838
json = formats::json::MakeObject("bar", "longlonglong");
3939
UEXPECT_THROW_MSG(
40-
json.As<ns::IntegerObject>(), chaotic::Error<userver::formats::json::Value>,
40+
json.As<ns::IntegerObject>(), chaotic::Error<formats::json::Value>,
4141
"Error at path 'bar': Too long string, maximum length=5, given=12"
4242
);
4343
}
4444

4545
TEST(MinMax, Array) {
4646
auto json = formats::json::MakeObject("zoo", formats::json::MakeArray(1));
4747
UEXPECT_THROW_MSG(
48-
json.As<ns::IntegerObject>(), chaotic::Error<userver::formats::json::Value>,
48+
json.As<ns::IntegerObject>(), chaotic::Error<formats::json::Value>,
4949
"Error at path 'zoo': Too short array, minimum length=2, given=1"
5050
);
5151

5252
json = formats::json::MakeObject("zoo", formats::json::MakeArray(1, 2, 3, 4, 5, 6, 7, 8));
5353
UEXPECT_THROW_MSG(
54-
json.As<ns::IntegerObject>(), chaotic::Error<userver::formats::json::Value>,
54+
json.As<ns::IntegerObject>(), chaotic::Error<formats::json::Value>,
5555
"Error at path 'zoo': Too long array, maximum length=5, given=8"
5656
);
5757
}

chaotic/integration_tests/tests/render/simple.cpp

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -45,15 +45,15 @@ TEST(Simple, DefaultFieldValue) {
4545
TEST(Simple, IntegerMinimum) {
4646
auto json = formats::json::MakeObject("int3", 1, "int", -10);
4747
UEXPECT_THROW_MSG(
48-
json.As<ns::SimpleObject>(), chaotic::Error<userver::formats::json::Value>,
48+
json.As<ns::SimpleObject>(), chaotic::Error<formats::json::Value>,
4949
"Error at path 'int': Invalid value, minimum=-1, given=-10"
5050
);
5151
}
5252

5353
TEST(Simple, IntegerMaximum) {
5454
auto json = formats::json::MakeObject("int3", 1, "int", 11);
5555
UEXPECT_THROW_MSG(
56-
json.As<ns::SimpleObject>(), chaotic::Error<userver::formats::json::Value>,
56+
json.As<ns::SimpleObject>(), chaotic::Error<formats::json::Value>,
5757
"Error at path 'int': Invalid value, maximum=10, given=11"
5858
);
5959
}
@@ -80,7 +80,7 @@ TEST(Simple, IntegerFormat) {
8080
TEST(Simple, ObjectWithRefType) {
8181
auto json = formats::json::MakeObject("integer", 0);
8282
UEXPECT_THROW_MSG(
83-
json.As<ns::ObjectWithRef>(), chaotic::Error<userver::formats::json::Value>,
83+
json.As<ns::ObjectWithRef>(), chaotic::Error<formats::json::Value>,
8484
"Error at path 'integer': Invalid value, minimum=1, given=0"
8585
);
8686
}
@@ -145,7 +145,7 @@ TEST(Simple, ObjectWithAdditionalPropertiesFalseStrict) {
145145
auto json = formats::json::MakeObject("foo", 1, "bar", 2);
146146
UEXPECT_THROW_MSG(
147147
json.As<ns::ObjectWithAdditionalPropertiesFalseStrict>(),
148-
chaotic::Error<userver::formats::json::Value>,
148+
chaotic::Error<formats::json::Value>,
149149
"Unknown property 'bar'"
150150
);
151151
}
@@ -161,7 +161,7 @@ TEST(Simple, IntegerEnum) {
161161
auto json2 = formats::json::MakeObject("one", 5);
162162
UEXPECT_THROW_MSG(
163163
json2["one"].As<ns::IntegerEnum>(),
164-
chaotic::Error<userver::formats::json::Value>,
164+
chaotic::Error<formats::json::Value>,
165165
"Error at path 'one': Invalid enum value (5) for type ns::IntegerEnum"
166166
);
167167

@@ -186,7 +186,7 @@ TEST(Simple, StringEnum) {
186186
auto json2 = formats::json::MakeObject("one", "zoo");
187187
UEXPECT_THROW_MSG(
188188
json2["one"].As<ns::StringEnum>(),
189-
chaotic::Error<userver::formats::json::Value>,
189+
chaotic::Error<formats::json::Value>,
190190
"Error at path 'one': Invalid enum value (zoo) for type ns::StringEnum"
191191
);
192192

0 commit comments

Comments
 (0)