Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
otb
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
Package registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
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
David Youssefi
otb
Commits
494b0625
Commit
494b0625
authored
14 years ago
by
Patrick Imbo
Browse files
Options
Downloads
Patches
Plain Diff
ENH: Testing if exception rised
parent
c7cd5cc2
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
Testing/Code/IO/otbDefaultImageMetadataInterface.cxx
+158
-0
158 additions, 0 deletions
Testing/Code/IO/otbDefaultImageMetadataInterface.cxx
with
158 additions
and
0 deletions
Testing/Code/IO/otbDefaultImageMetadataInterface.cxx
+
158
−
0
View file @
494b0625
...
@@ -29,6 +29,10 @@ int otbDefaultImageMetadataInterface(int argc, char* argv[])
...
@@ -29,6 +29,10 @@ int otbDefaultImageMetadataInterface(int argc, char* argv[])
ObjectType
::
Pointer
obj
=
ObjectType
::
New
();
ObjectType
::
Pointer
obj
=
ObjectType
::
New
();
bool
hasRisedException
;
hasRisedException
=
false
;
try
try
{
{
std
::
cout
<<
obj
->
GetPhysicalBias
()
<<
std
::
endl
;
std
::
cout
<<
obj
->
GetPhysicalBias
()
<<
std
::
endl
;
...
@@ -37,8 +41,18 @@ int otbDefaultImageMetadataInterface(int argc, char* argv[])
...
@@ -37,8 +41,18 @@ int otbDefaultImageMetadataInterface(int argc, char* argv[])
{
{
std
::
cout
<<
"ExceptionObject caught for GetPhysicalBias() !"
<<
std
::
endl
;
std
::
cout
<<
"ExceptionObject caught for GetPhysicalBias() !"
<<
std
::
endl
;
std
::
cout
<<
err
<<
std
::
endl
;
std
::
cout
<<
err
<<
std
::
endl
;
hasRisedException
=
true
;
}
if
(
!
hasRisedException
)
{
std
::
cerr
<<
" Should has raise an exception !"
<<
std
::
endl
;
return
EXIT_FAILURE
;
}
}
hasRisedException
=
false
;
try
try
{
{
std
::
cout
<<
obj
->
GetPhysicalGain
()
<<
std
::
endl
;
std
::
cout
<<
obj
->
GetPhysicalGain
()
<<
std
::
endl
;
...
@@ -47,8 +61,17 @@ int otbDefaultImageMetadataInterface(int argc, char* argv[])
...
@@ -47,8 +61,17 @@ int otbDefaultImageMetadataInterface(int argc, char* argv[])
{
{
std
::
cout
<<
"ExceptionObject caught for GetPhysicalGain() !"
<<
std
::
endl
;
std
::
cout
<<
"ExceptionObject caught for GetPhysicalGain() !"
<<
std
::
endl
;
std
::
cout
<<
err
<<
std
::
endl
;
std
::
cout
<<
err
<<
std
::
endl
;
hasRisedException
=
true
;
}
if
(
!
hasRisedException
)
{
std
::
cerr
<<
" Should has raise an exception !"
<<
std
::
endl
;
return
EXIT_FAILURE
;
}
}
hasRisedException
=
false
;
try
try
{
{
std
::
cout
<<
obj
->
GetSolarIrradiance
()
<<
std
::
endl
;
std
::
cout
<<
obj
->
GetSolarIrradiance
()
<<
std
::
endl
;
...
@@ -57,8 +80,17 @@ int otbDefaultImageMetadataInterface(int argc, char* argv[])
...
@@ -57,8 +80,17 @@ int otbDefaultImageMetadataInterface(int argc, char* argv[])
{
{
std
::
cout
<<
"ExceptionObject caught for GetSolarIrradiance() !"
<<
std
::
endl
;
std
::
cout
<<
"ExceptionObject caught for GetSolarIrradiance() !"
<<
std
::
endl
;
std
::
cout
<<
err
<<
std
::
endl
;
std
::
cout
<<
err
<<
std
::
endl
;
hasRisedException
=
true
;
}
if
(
!
hasRisedException
)
{
std
::
cerr
<<
" Should has raise an exception !"
<<
std
::
endl
;
return
EXIT_FAILURE
;
}
}
hasRisedException
=
false
;
try
try
{
{
std
::
cout
<<
obj
->
GetDay
()
<<
std
::
endl
;
std
::
cout
<<
obj
->
GetDay
()
<<
std
::
endl
;
...
@@ -67,8 +99,17 @@ int otbDefaultImageMetadataInterface(int argc, char* argv[])
...
@@ -67,8 +99,17 @@ int otbDefaultImageMetadataInterface(int argc, char* argv[])
{
{
std
::
cout
<<
"ExceptionObject caught for GetDay() !"
<<
std
::
endl
;
std
::
cout
<<
"ExceptionObject caught for GetDay() !"
<<
std
::
endl
;
std
::
cout
<<
err
<<
std
::
endl
;
std
::
cout
<<
err
<<
std
::
endl
;
hasRisedException
=
true
;
}
if
(
!
hasRisedException
)
{
std
::
cerr
<<
" Should has raise an exception !"
<<
std
::
endl
;
return
EXIT_FAILURE
;
}
}
hasRisedException
=
false
;
try
try
{
{
std
::
cout
<<
obj
->
GetMonth
()
<<
std
::
endl
;
std
::
cout
<<
obj
->
GetMonth
()
<<
std
::
endl
;
...
@@ -77,8 +118,17 @@ int otbDefaultImageMetadataInterface(int argc, char* argv[])
...
@@ -77,8 +118,17 @@ int otbDefaultImageMetadataInterface(int argc, char* argv[])
{
{
std
::
cout
<<
"ExceptionObject caught for GetMonth() !"
<<
std
::
endl
;
std
::
cout
<<
"ExceptionObject caught for GetMonth() !"
<<
std
::
endl
;
std
::
cout
<<
err
<<
std
::
endl
;
std
::
cout
<<
err
<<
std
::
endl
;
hasRisedException
=
true
;
}
}
if
(
!
hasRisedException
)
{
std
::
cerr
<<
" Should has raise an exception !"
<<
std
::
endl
;
return
EXIT_FAILURE
;
}
hasRisedException
=
false
;
try
try
{
{
std
::
cout
<<
obj
->
GetYear
()
<<
std
::
endl
;
std
::
cout
<<
obj
->
GetYear
()
<<
std
::
endl
;
...
@@ -87,8 +137,17 @@ int otbDefaultImageMetadataInterface(int argc, char* argv[])
...
@@ -87,8 +137,17 @@ int otbDefaultImageMetadataInterface(int argc, char* argv[])
{
{
std
::
cout
<<
"ExceptionObject caught for GetYear() !"
<<
std
::
endl
;
std
::
cout
<<
"ExceptionObject caught for GetYear() !"
<<
std
::
endl
;
std
::
cout
<<
err
<<
std
::
endl
;
std
::
cout
<<
err
<<
std
::
endl
;
hasRisedException
=
true
;
}
}
if
(
!
hasRisedException
)
{
std
::
cerr
<<
" Should has raise an exception !"
<<
std
::
endl
;
return
EXIT_FAILURE
;
}
hasRisedException
=
false
;
try
try
{
{
std
::
cout
<<
obj
->
GetHour
()
<<
std
::
endl
;
std
::
cout
<<
obj
->
GetHour
()
<<
std
::
endl
;
...
@@ -97,8 +156,17 @@ int otbDefaultImageMetadataInterface(int argc, char* argv[])
...
@@ -97,8 +156,17 @@ int otbDefaultImageMetadataInterface(int argc, char* argv[])
{
{
std
::
cout
<<
"ExceptionObject caught for GetHour() !"
<<
std
::
endl
;
std
::
cout
<<
"ExceptionObject caught for GetHour() !"
<<
std
::
endl
;
std
::
cout
<<
err
<<
std
::
endl
;
std
::
cout
<<
err
<<
std
::
endl
;
hasRisedException
=
true
;
}
}
if
(
!
hasRisedException
)
{
std
::
cerr
<<
" Should has raise an exception !"
<<
std
::
endl
;
return
EXIT_FAILURE
;
}
hasRisedException
=
false
;
try
try
{
{
std
::
cout
<<
obj
->
GetMinute
()
<<
std
::
endl
;
std
::
cout
<<
obj
->
GetMinute
()
<<
std
::
endl
;
...
@@ -107,8 +175,17 @@ int otbDefaultImageMetadataInterface(int argc, char* argv[])
...
@@ -107,8 +175,17 @@ int otbDefaultImageMetadataInterface(int argc, char* argv[])
{
{
std
::
cout
<<
"ExceptionObject caught for GetMinute() !"
<<
std
::
endl
;
std
::
cout
<<
"ExceptionObject caught for GetMinute() !"
<<
std
::
endl
;
std
::
cout
<<
err
<<
std
::
endl
;
std
::
cout
<<
err
<<
std
::
endl
;
hasRisedException
=
true
;
}
}
if
(
!
hasRisedException
)
{
std
::
cerr
<<
" Should has raise an exception !"
<<
std
::
endl
;
return
EXIT_FAILURE
;
}
hasRisedException
=
false
;
try
try
{
{
std
::
cout
<<
obj
->
GetProductionDay
()
<<
std
::
endl
;
std
::
cout
<<
obj
->
GetProductionDay
()
<<
std
::
endl
;
...
@@ -117,8 +194,17 @@ int otbDefaultImageMetadataInterface(int argc, char* argv[])
...
@@ -117,8 +194,17 @@ int otbDefaultImageMetadataInterface(int argc, char* argv[])
{
{
std
::
cout
<<
"ExceptionObject caught for GetProductionDay() !"
<<
std
::
endl
;
std
::
cout
<<
"ExceptionObject caught for GetProductionDay() !"
<<
std
::
endl
;
std
::
cout
<<
err
<<
std
::
endl
;
std
::
cout
<<
err
<<
std
::
endl
;
hasRisedException
=
true
;
}
}
if
(
!
hasRisedException
)
{
std
::
cerr
<<
" Should has raise an exception !"
<<
std
::
endl
;
return
EXIT_FAILURE
;
}
hasRisedException
=
false
;
try
try
{
{
std
::
cout
<<
obj
->
GetProductionMonth
()
<<
std
::
endl
;
std
::
cout
<<
obj
->
GetProductionMonth
()
<<
std
::
endl
;
...
@@ -127,8 +213,17 @@ int otbDefaultImageMetadataInterface(int argc, char* argv[])
...
@@ -127,8 +213,17 @@ int otbDefaultImageMetadataInterface(int argc, char* argv[])
{
{
std
::
cout
<<
"ExceptionObject caught for GetProductionMonth() !"
<<
std
::
endl
;
std
::
cout
<<
"ExceptionObject caught for GetProductionMonth() !"
<<
std
::
endl
;
std
::
cout
<<
err
<<
std
::
endl
;
std
::
cout
<<
err
<<
std
::
endl
;
hasRisedException
=
true
;
}
}
if
(
!
hasRisedException
)
{
std
::
cerr
<<
" Should has raise an exception !"
<<
std
::
endl
;
return
EXIT_FAILURE
;
}
hasRisedException
=
false
;
try
try
{
{
std
::
cout
<<
obj
->
GetProductionYear
()
<<
std
::
endl
;
std
::
cout
<<
obj
->
GetProductionYear
()
<<
std
::
endl
;
...
@@ -137,8 +232,17 @@ int otbDefaultImageMetadataInterface(int argc, char* argv[])
...
@@ -137,8 +232,17 @@ int otbDefaultImageMetadataInterface(int argc, char* argv[])
{
{
std
::
cout
<<
"ExceptionObject caught for GetProductionYear() !"
<<
std
::
endl
;
std
::
cout
<<
"ExceptionObject caught for GetProductionYear() !"
<<
std
::
endl
;
std
::
cout
<<
err
<<
std
::
endl
;
std
::
cout
<<
err
<<
std
::
endl
;
hasRisedException
=
true
;
}
if
(
!
hasRisedException
)
{
std
::
cerr
<<
" Should has raise an exception !"
<<
std
::
endl
;
return
EXIT_FAILURE
;
}
}
hasRisedException
=
false
;
try
try
{
{
std
::
cout
<<
obj
->
GetSatElevation
()
<<
std
::
endl
;
std
::
cout
<<
obj
->
GetSatElevation
()
<<
std
::
endl
;
...
@@ -147,8 +251,17 @@ int otbDefaultImageMetadataInterface(int argc, char* argv[])
...
@@ -147,8 +251,17 @@ int otbDefaultImageMetadataInterface(int argc, char* argv[])
{
{
std
::
cout
<<
"ExceptionObject caught for GetSatElevation() !"
<<
std
::
endl
;
std
::
cout
<<
"ExceptionObject caught for GetSatElevation() !"
<<
std
::
endl
;
std
::
cout
<<
err
<<
std
::
endl
;
std
::
cout
<<
err
<<
std
::
endl
;
hasRisedException
=
true
;
}
if
(
!
hasRisedException
)
{
std
::
cerr
<<
" Should has raise an exception !"
<<
std
::
endl
;
return
EXIT_FAILURE
;
}
}
hasRisedException
=
false
;
try
try
{
{
std
::
cout
<<
obj
->
GetSatAzimuth
()
<<
std
::
endl
;
std
::
cout
<<
obj
->
GetSatAzimuth
()
<<
std
::
endl
;
...
@@ -157,8 +270,17 @@ int otbDefaultImageMetadataInterface(int argc, char* argv[])
...
@@ -157,8 +270,17 @@ int otbDefaultImageMetadataInterface(int argc, char* argv[])
{
{
std
::
cout
<<
"ExceptionObject caught for GetSatAzimuth() !"
<<
std
::
endl
;
std
::
cout
<<
"ExceptionObject caught for GetSatAzimuth() !"
<<
std
::
endl
;
std
::
cout
<<
err
<<
std
::
endl
;
std
::
cout
<<
err
<<
std
::
endl
;
hasRisedException
=
true
;
}
if
(
!
hasRisedException
)
{
std
::
cerr
<<
" Should has raise an exception !"
<<
std
::
endl
;
return
EXIT_FAILURE
;
}
}
hasRisedException
=
false
;
try
try
{
{
std
::
cout
<<
obj
->
GetFirstWavelengths
()
<<
std
::
endl
;
std
::
cout
<<
obj
->
GetFirstWavelengths
()
<<
std
::
endl
;
...
@@ -167,8 +289,17 @@ int otbDefaultImageMetadataInterface(int argc, char* argv[])
...
@@ -167,8 +289,17 @@ int otbDefaultImageMetadataInterface(int argc, char* argv[])
{
{
std
::
cout
<<
"ExceptionObject caught for GetFirstWavelengths() !"
<<
std
::
endl
;
std
::
cout
<<
"ExceptionObject caught for GetFirstWavelengths() !"
<<
std
::
endl
;
std
::
cout
<<
err
<<
std
::
endl
;
std
::
cout
<<
err
<<
std
::
endl
;
hasRisedException
=
true
;
}
}
if
(
!
hasRisedException
)
{
std
::
cerr
<<
" Should has raise an exception !"
<<
std
::
endl
;
return
EXIT_FAILURE
;
}
hasRisedException
=
false
;
try
try
{
{
std
::
cout
<<
obj
->
GetLastWavelengths
()
<<
std
::
endl
;
std
::
cout
<<
obj
->
GetLastWavelengths
()
<<
std
::
endl
;
...
@@ -177,8 +308,17 @@ int otbDefaultImageMetadataInterface(int argc, char* argv[])
...
@@ -177,8 +308,17 @@ int otbDefaultImageMetadataInterface(int argc, char* argv[])
{
{
std
::
cout
<<
"ExceptionObject caught for GetLastWavelengths() !"
<<
std
::
endl
;
std
::
cout
<<
"ExceptionObject caught for GetLastWavelengths() !"
<<
std
::
endl
;
std
::
cout
<<
err
<<
std
::
endl
;
std
::
cout
<<
err
<<
std
::
endl
;
hasRisedException
=
true
;
}
}
if
(
!
hasRisedException
)
{
std
::
cerr
<<
" Should has raise an exception !"
<<
std
::
endl
;
return
EXIT_FAILURE
;
}
hasRisedException
=
false
;
try
try
{
{
if
(
obj
->
CanRead
()
!=
true
)
if
(
obj
->
CanRead
()
!=
true
)
...
@@ -191,8 +331,17 @@ int otbDefaultImageMetadataInterface(int argc, char* argv[])
...
@@ -191,8 +331,17 @@ int otbDefaultImageMetadataInterface(int argc, char* argv[])
{
{
std
::
cout
<<
"ExceptionObject caught for CanRead() !"
<<
std
::
endl
;
std
::
cout
<<
"ExceptionObject caught for CanRead() !"
<<
std
::
endl
;
std
::
cout
<<
err
<<
std
::
endl
;
std
::
cout
<<
err
<<
std
::
endl
;
hasRisedException
=
true
;
}
}
if
(
!
hasRisedException
)
{
std
::
cerr
<<
" Should has raise an exception !"
<<
std
::
endl
;
return
EXIT_FAILURE
;
}
hasRisedException
=
false
;
try
try
{
{
std
::
vector
<
unsigned
int
>
rgb
(
3
);
std
::
vector
<
unsigned
int
>
rgb
(
3
);
...
@@ -208,8 +357,17 @@ int otbDefaultImageMetadataInterface(int argc, char* argv[])
...
@@ -208,8 +357,17 @@ int otbDefaultImageMetadataInterface(int argc, char* argv[])
{
{
std
::
cout
<<
"ExceptionObject caught for GetDefaultDisplay() !"
<<
std
::
endl
;
std
::
cout
<<
"ExceptionObject caught for GetDefaultDisplay() !"
<<
std
::
endl
;
std
::
cout
<<
err
<<
std
::
endl
;
std
::
cout
<<
err
<<
std
::
endl
;
hasRisedException
=
true
;
}
}
if
(
!
hasRisedException
)
{
std
::
cerr
<<
" Should has raise an exception !"
<<
std
::
endl
;
return
EXIT_FAILURE
;
}
hasRisedException
=
false
;
return
EXIT_SUCCESS
;
return
EXIT_SUCCESS
;
}
}
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