Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
Z
Zipr Toolchain
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
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
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Open Source Software
Zipr Toolchain
Commits
fdb2edaa
Commit
fdb2edaa
authored
9 years ago
by
whh8b
Browse files
Options
Downloads
Patches
Plain Diff
Add tests for ZiprDoubleOption_t
parent
8ae7e2ea
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
test/ZiprOptions.cpp
+18
-0
18 additions, 0 deletions
test/ZiprOptions.cpp
with
18 additions
and
0 deletions
test/ZiprOptions.cpp
+
18
−
0
View file @
fdb2edaa
...
...
@@ -62,6 +62,10 @@ int main(int argc, char *argv[])
ZiprIntegerOption_t
local_e_option
(
"e"
);
cout
<<
"Constructing ZiprIntegerOption_t('e')."
<<
endl
;
ZiprIntegerOption_t
local_shadow_e_option
(
"e"
);
cout
<<
"Constructing ZiprDoubleOption_t('f')."
<<
endl
;
ZiprDoubleOption_t
local_f_option
(
"f"
);
cout
<<
"Constructing ZiprDoubleOption_t('g', 2.4)."
<<
endl
;
ZiprDoubleOption_t
local_g_option
(
"g"
,
2.4
);
local_b_option
.
SetRequired
(
true
);
local_b_option
.
SetDescription
(
"Set the B option."
);
...
...
@@ -76,6 +80,8 @@ int main(int argc, char *argv[])
local_ns
.
AddOption
(
&
local_d_option
);
local_ns
.
AddOption
(
&
local_e_option
);
local_ns
.
AddOption
(
&
local_shadow_e_option
);
local_ns
.
AddOption
(
&
local_f_option
);
local_ns
.
AddOption
(
&
local_g_option
);
options
.
AddNamespace
(
&
global_ns
);
options
.
AddNamespace
(
&
local_ns
);
...
...
@@ -119,4 +125,16 @@ int main(int argc, char *argv[])
if
(
local_shadow_e_option
==
local_e_option
)
{
cout
<<
"local_shadow_e_option == local_e_option"
<<
endl
;
}
if
(
local_g_option
==
2.5
)
{
cout
<<
"local_g_option is 2.5!"
<<
endl
;
}
if
(
local_g_option
!=
2.5
)
{
cout
<<
"local_g_option is NOT 2.5!"
<<
endl
;
}
if
(
local_g_option
)
{
cout
<<
"local_g_option is!"
<<
endl
;
}
if
(
!
local_g_option
)
{
cout
<<
"local_g_option is NOT!"
<<
endl
;
}
}
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