Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
W
WCCL
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Redmine
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Analysers
WCCL
Commits
02c08af5
Commit
02c08af5
authored
Nov 9, 2010
by
Adam Wardyński
Browse files
Options
Downloads
Patches
Plain Diff
Changing string representation of Value::Bool to be first uppercase letter, per spec
parent
27f352d9
No related branches found
No related tags found
No related merge requests found
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
libwccl/values/bool.h
+1
-1
1 addition, 1 deletion
libwccl/values/bool.h
tests/constant_tests.cpp
+4
-4
4 additions, 4 deletions
tests/constant_tests.cpp
tests/logicalpredicates.cpp
+27
-27
27 additions, 27 deletions
tests/logicalpredicates.cpp
with
32 additions
and
32 deletions
libwccl/values/bool.h
+
1
−
1
View file @
02c08af5
...
...
@@ -29,7 +29,7 @@ public:
/// Value override
std
::
string
to_raw_string
()
const
{
return
val_
?
"
t
rue"
:
"
f
alse"
;
return
val_
?
"
T
rue"
:
"
F
alse"
;
}
private
:
...
...
This diff is collapsed.
Click to expand it.
tests/constant_tests.cpp
+
4
−
4
View file @
02c08af5
...
...
@@ -42,17 +42,17 @@ BOOST_FIXTURE_TEST_CASE(bool_apply, BoolFix)
BOOST_FIXTURE_TEST_CASE
(
bool_to_string
,
BoolFix
)
{
BOOST_CHECK_EQUAL
(
"
t
rue"
,
true_value
.
to_string
(
tagset
));
BOOST_CHECK_EQUAL
(
"
T
rue"
,
true_value
.
to_string
(
tagset
));
BOOST_CHECK_EQUAL
(
true_value
.
to_string
(
tagset
),
true_constant
.
to_string
(
tagset
));
BOOST_CHECK_EQUAL
(
"
f
alse"
,
false_value
.
to_string
(
tagset
));
BOOST_CHECK_EQUAL
(
"
F
alse"
,
false_value
.
to_string
(
tagset
));
BOOST_CHECK_EQUAL
(
false_value
.
to_string
(
tagset
),
false_constant
.
to_string
(
tagset
));
}
BOOST_FIXTURE_TEST_CASE
(
bool_to_raw_string
,
BoolFix
)
{
BOOST_CHECK_EQUAL
(
"
t
rue"
,
true_value
.
to_raw_string
());
BOOST_CHECK_EQUAL
(
"
T
rue"
,
true_value
.
to_raw_string
());
BOOST_CHECK_EQUAL
(
true_value
.
to_raw_string
(),
true_constant
.
to_raw_string
());
BOOST_CHECK_EQUAL
(
"
f
alse"
,
false_value
.
to_raw_string
());
BOOST_CHECK_EQUAL
(
"
F
alse"
,
false_value
.
to_raw_string
());
BOOST_CHECK_EQUAL
(
false_value
.
to_raw_string
(),
false_constant
.
to_raw_string
());
}
...
...
This diff is collapsed.
Click to expand it.
tests/logicalpredicates.cpp
+
27
−
27
View file @
02c08af5
...
...
@@ -172,19 +172,19 @@ BOOST_FIXTURE_TEST_CASE(and_to_string, PredFix)
boost
::
shared_ptr
<
And
::
BoolFunctionPtrVector
>
v
(
new
And
::
BoolFunctionPtrVector
());
v
->
push_back
(
true_constant
);
boost
::
shared_ptr
<
Function
<
Bool
>
>
pred_and
(
new
And
(
v
));
BOOST_CHECK_EQUAL
(
"and(
t
rue)"
,
pred_and
->
to_string
(
tagset
));
BOOST_CHECK_EQUAL
(
"and(
T
rue)"
,
pred_and
->
to_string
(
tagset
));
v
->
push_back
(
false_constant
);
BOOST_CHECK_EQUAL
(
"and(
t
rue,
f
alse)"
,
pred_and
->
to_string
(
tagset
));
BOOST_CHECK_EQUAL
(
"and(
T
rue,
F
alse)"
,
pred_and
->
to_string
(
tagset
));
v
->
push_back
(
true_constant
);
BOOST_CHECK_EQUAL
(
"and(
t
rue,
f
alse,
t
rue)"
,
pred_and
->
to_string
(
tagset
));
BOOST_CHECK_EQUAL
(
"and(
T
rue,
F
alse,
T
rue)"
,
pred_and
->
to_string
(
tagset
));
boost
::
shared_ptr
<
And
::
BoolFunctionPtrVector
>
v2
(
new
And
::
BoolFunctionPtrVector
());
v2
->
push_back
(
false_constant
);
v2
->
push_back
(
pred_and
);
And
another_and
(
v2
);
BOOST_CHECK_EQUAL
(
"and(
f
alse, and(
t
rue,
f
alse,
t
rue))"
,
another_and
.
to_string
(
tagset
));
BOOST_CHECK_EQUAL
(
"and(
F
alse, and(
T
rue,
F
alse,
T
rue))"
,
another_and
.
to_string
(
tagset
));
v2
->
push_back
(
false_constant
);
BOOST_CHECK_EQUAL
(
"and(
f
alse, and(
t
rue,
f
alse,
t
rue),
f
alse)"
,
another_and
.
to_string
(
tagset
));
BOOST_CHECK_EQUAL
(
"and(
F
alse, and(
T
rue,
F
alse,
T
rue),
F
alse)"
,
another_and
.
to_string
(
tagset
));
}
BOOST_FIXTURE_TEST_CASE
(
and_to_raw_string
,
PredFix
)
...
...
@@ -192,17 +192,17 @@ BOOST_FIXTURE_TEST_CASE(and_to_raw_string, PredFix)
boost
::
shared_ptr
<
And
::
BoolFunctionPtrVector
>
v
(
new
And
::
BoolFunctionPtrVector
());
v
->
push_back
(
false_constant
);
boost
::
shared_ptr
<
Function
<
Bool
>
>
pred_and
(
new
And
(
v
));
BOOST_CHECK_EQUAL
(
"and(
f
alse)"
,
pred_and
->
to_raw_string
());
BOOST_CHECK_EQUAL
(
"and(
F
alse)"
,
pred_and
->
to_raw_string
());
v
->
push_back
(
true_constant
);
BOOST_CHECK_EQUAL
(
"and(
f
alse,
t
rue)"
,
pred_and
->
to_raw_string
());
BOOST_CHECK_EQUAL
(
"and(
F
alse,
T
rue)"
,
pred_and
->
to_raw_string
());
v
->
push_back
(
true_constant
);
BOOST_CHECK_EQUAL
(
"and(
f
alse,
t
rue,
t
rue)"
,
pred_and
->
to_raw_string
());
BOOST_CHECK_EQUAL
(
"and(
F
alse,
T
rue,
T
rue)"
,
pred_and
->
to_raw_string
());
boost
::
shared_ptr
<
And
::
BoolFunctionPtrVector
>
v2
(
new
And
::
BoolFunctionPtrVector
());
v2
->
push_back
(
true_constant
);
v2
->
push_back
(
pred_and
);
And
another_and
(
v2
);
BOOST_CHECK_EQUAL
(
"and(
t
rue, and(
f
alse,
t
rue,
t
rue))"
,
another_and
.
to_raw_string
());
BOOST_CHECK_EQUAL
(
"and(
T
rue, and(
F
alse,
T
rue,
T
rue))"
,
another_and
.
to_raw_string
());
}
BOOST_FIXTURE_TEST_CASE
(
or_to_string
,
PredFix
)
...
...
@@ -210,19 +210,19 @@ BOOST_FIXTURE_TEST_CASE(or_to_string, PredFix)
boost
::
shared_ptr
<
Or
::
BoolFunctionPtrVector
>
v
(
new
Or
::
BoolFunctionPtrVector
());
v
->
push_back
(
true_constant
);
boost
::
shared_ptr
<
Function
<
Bool
>
>
pred_or
(
new
Or
(
v
));
BOOST_CHECK_EQUAL
(
"or(
t
rue)"
,
pred_or
->
to_string
(
tagset
));
BOOST_CHECK_EQUAL
(
"or(
T
rue)"
,
pred_or
->
to_string
(
tagset
));
v
->
push_back
(
false_constant
);
BOOST_CHECK_EQUAL
(
"or(
t
rue,
f
alse)"
,
pred_or
->
to_string
(
tagset
));
BOOST_CHECK_EQUAL
(
"or(
T
rue,
F
alse)"
,
pred_or
->
to_string
(
tagset
));
v
->
push_back
(
true_constant
);
BOOST_CHECK_EQUAL
(
"or(
t
rue,
f
alse,
t
rue)"
,
pred_or
->
to_string
(
tagset
));
BOOST_CHECK_EQUAL
(
"or(
T
rue,
F
alse,
T
rue)"
,
pred_or
->
to_string
(
tagset
));
boost
::
shared_ptr
<
Or
::
BoolFunctionPtrVector
>
v2
(
new
Or
::
BoolFunctionPtrVector
());
v2
->
push_back
(
pred_or
);
v2
->
push_back
(
false_constant
);
Or
another_or
(
v2
);
BOOST_CHECK_EQUAL
(
"or(or(
t
rue,
f
alse,
t
rue),
f
alse)"
,
another_or
.
to_string
(
tagset
));
BOOST_CHECK_EQUAL
(
"or(or(
T
rue,
F
alse,
T
rue),
F
alse)"
,
another_or
.
to_string
(
tagset
));
v2
->
push_back
(
true_constant
);
BOOST_CHECK_EQUAL
(
"or(or(
t
rue,
f
alse,
t
rue),
f
alse,
t
rue)"
,
another_or
.
to_string
(
tagset
));
BOOST_CHECK_EQUAL
(
"or(or(
T
rue,
F
alse,
T
rue),
F
alse,
T
rue)"
,
another_or
.
to_string
(
tagset
));
}
BOOST_FIXTURE_TEST_CASE
(
or_to_raw_string
,
PredFix
)
...
...
@@ -230,17 +230,17 @@ BOOST_FIXTURE_TEST_CASE(or_to_raw_string, PredFix)
boost
::
shared_ptr
<
Or
::
BoolFunctionPtrVector
>
v
(
new
Or
::
BoolFunctionPtrVector
());
v
->
push_back
(
false_constant
);
boost
::
shared_ptr
<
Function
<
Bool
>
>
pred_or
(
new
Or
(
v
));
BOOST_CHECK_EQUAL
(
"or(
f
alse)"
,
pred_or
->
to_raw_string
());
BOOST_CHECK_EQUAL
(
"or(
F
alse)"
,
pred_or
->
to_raw_string
());
v
->
push_back
(
true_constant
);
BOOST_CHECK_EQUAL
(
"or(
f
alse,
t
rue)"
,
pred_or
->
to_raw_string
());
BOOST_CHECK_EQUAL
(
"or(
F
alse,
T
rue)"
,
pred_or
->
to_raw_string
());
v
->
push_back
(
true_constant
);
BOOST_CHECK_EQUAL
(
"or(
f
alse,
t
rue,
t
rue)"
,
pred_or
->
to_raw_string
());
BOOST_CHECK_EQUAL
(
"or(
F
alse,
T
rue,
T
rue)"
,
pred_or
->
to_raw_string
());
boost
::
shared_ptr
<
Or
::
BoolFunctionPtrVector
>
v2
(
new
Or
::
BoolFunctionPtrVector
());
v2
->
push_back
(
true_constant
);
v2
->
push_back
(
pred_or
);
Or
another_or
(
v2
);
BOOST_CHECK_EQUAL
(
"or(
t
rue, or(
f
alse,
t
rue,
t
rue))"
,
another_or
.
to_raw_string
());
BOOST_CHECK_EQUAL
(
"or(
T
rue, or(
F
alse,
T
rue,
T
rue))"
,
another_or
.
to_raw_string
());
}
BOOST_FIXTURE_TEST_CASE
(
nor_to_string
,
PredFix
)
...
...
@@ -248,19 +248,19 @@ BOOST_FIXTURE_TEST_CASE(nor_to_string, PredFix)
boost
::
shared_ptr
<
Nor
::
BoolFunctionPtrVector
>
v
(
new
Nor
::
BoolFunctionPtrVector
());
v
->
push_back
(
true_constant
);
boost
::
shared_ptr
<
Function
<
Bool
>
>
pred_nor
(
new
Nor
(
v
));
BOOST_CHECK_EQUAL
(
"not(
t
rue)"
,
pred_nor
->
to_string
(
tagset
));
BOOST_CHECK_EQUAL
(
"not(
T
rue)"
,
pred_nor
->
to_string
(
tagset
));
v
->
push_back
(
false_constant
);
BOOST_CHECK_EQUAL
(
"not(
t
rue,
f
alse)"
,
pred_nor
->
to_string
(
tagset
));
BOOST_CHECK_EQUAL
(
"not(
T
rue,
F
alse)"
,
pred_nor
->
to_string
(
tagset
));
v
->
push_back
(
true_constant
);
BOOST_CHECK_EQUAL
(
"not(
t
rue,
f
alse,
t
rue)"
,
pred_nor
->
to_string
(
tagset
));
BOOST_CHECK_EQUAL
(
"not(
T
rue,
F
alse,
T
rue)"
,
pred_nor
->
to_string
(
tagset
));
boost
::
shared_ptr
<
Or
::
BoolFunctionPtrVector
>
v2
(
new
Nor
::
BoolFunctionPtrVector
());
v2
->
push_back
(
pred_nor
);
v2
->
push_back
(
false_constant
);
Nor
another_nor
(
v2
);
BOOST_CHECK_EQUAL
(
"not(not(
t
rue,
f
alse,
t
rue),
f
alse)"
,
another_nor
.
to_string
(
tagset
));
BOOST_CHECK_EQUAL
(
"not(not(
T
rue,
F
alse,
T
rue),
F
alse)"
,
another_nor
.
to_string
(
tagset
));
v2
->
push_back
(
true_constant
);
BOOST_CHECK_EQUAL
(
"not(not(
t
rue,
f
alse,
t
rue),
f
alse,
t
rue)"
,
another_nor
.
to_string
(
tagset
));
BOOST_CHECK_EQUAL
(
"not(not(
T
rue,
F
alse,
T
rue),
F
alse,
T
rue)"
,
another_nor
.
to_string
(
tagset
));
}
BOOST_FIXTURE_TEST_CASE
(
nor_to_raw_string
,
PredFix
)
...
...
@@ -268,17 +268,17 @@ BOOST_FIXTURE_TEST_CASE(nor_to_raw_string, PredFix)
boost
::
shared_ptr
<
Or
::
BoolFunctionPtrVector
>
v
(
new
Nor
::
BoolFunctionPtrVector
());
v
->
push_back
(
false_constant
);
boost
::
shared_ptr
<
Function
<
Bool
>
>
pred_nor
(
new
Nor
(
v
));
BOOST_CHECK_EQUAL
(
"not(
f
alse)"
,
pred_nor
->
to_raw_string
());
BOOST_CHECK_EQUAL
(
"not(
F
alse)"
,
pred_nor
->
to_raw_string
());
v
->
push_back
(
true_constant
);
BOOST_CHECK_EQUAL
(
"not(
f
alse,
t
rue)"
,
pred_nor
->
to_raw_string
());
BOOST_CHECK_EQUAL
(
"not(
F
alse,
T
rue)"
,
pred_nor
->
to_raw_string
());
v
->
push_back
(
true_constant
);
BOOST_CHECK_EQUAL
(
"not(
f
alse,
t
rue,
t
rue)"
,
pred_nor
->
to_raw_string
());
BOOST_CHECK_EQUAL
(
"not(
F
alse,
T
rue,
T
rue)"
,
pred_nor
->
to_raw_string
());
boost
::
shared_ptr
<
Nor
::
BoolFunctionPtrVector
>
v2
(
new
Nor
::
BoolFunctionPtrVector
());
v2
->
push_back
(
true_constant
);
v2
->
push_back
(
pred_nor
);
Nor
another_nor
(
v2
);
BOOST_CHECK_EQUAL
(
"not(
t
rue, not(
f
alse,
t
rue,
t
rue))"
,
another_nor
.
to_raw_string
());
BOOST_CHECK_EQUAL
(
"not(
T
rue, not(
F
alse,
T
rue,
T
rue))"
,
another_nor
.
to_raw_string
());
}
BOOST_AUTO_TEST_SUITE_END
()
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment