Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
O
ogs-feliks
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
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
Feliks Kiszkurno
ogs-feliks
Commits
3889a8c4
Commit
3889a8c4
authored
10 months ago
by
Christoph Lehmann
Browse files
Options
Downloads
Patches
Plain Diff
[T] Added unit tests for model eval oder check
parent
55399d30
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
Tests/CMakeLists.txt
+1
-0
1 addition, 0 deletions
Tests/CMakeLists.txt
Tests/ProcessLib/Graph/TestCheckEvalOrderRT.cpp
+164
-0
164 additions, 0 deletions
Tests/ProcessLib/Graph/TestCheckEvalOrderRT.cpp
with
165 additions
and
0 deletions
Tests/CMakeLists.txt
+
1
−
0
View file @
3889a8c4
...
@@ -88,6 +88,7 @@ ogs_add_executable(testrunner ${TEST_SOURCES})
...
@@ -88,6 +88,7 @@ ogs_add_executable(testrunner ${TEST_SOURCES})
target_sources
(
target_sources
(
testrunner PRIVATE ProcessLib/Graph/TestGet.cpp
testrunner PRIVATE ProcessLib/Graph/TestGet.cpp
ProcessLib/Graph/TestApply.cpp
ProcessLib/Graph/TestApply.cpp
ProcessLib/Graph/TestCheckEvalOrderRT.cpp
)
)
target_link_libraries
(
target_link_libraries
(
...
...
This diff is collapsed.
Click to expand it.
Tests/ProcessLib/Graph/TestCheckEvalOrderRT.cpp
0 → 100644
+
164
−
0
View file @
3889a8c4
/**
* \file
* \copyright
* Copyright (c) 2012-2024, OpenGeoSys Community (http://www.opengeosys.org)
* Distributed under a Modified BSD License.
* See accompanying file LICENSE.txt or
* http://www.opengeosys.org/project/license
*
*/
#include
<gtest/gtest.h>
#include
"ProcessLib/Graph/CheckEvalOrderRT.h"
namespace
TestCheckEvalOrderRT
{
struct
NoOp
{
void
eval
();
};
struct
OutD
{
void
eval
(
double
&
)
{}
};
struct
InD
{
void
eval
(
double
const
&
)
{}
};
struct
InSOutD
{
void
eval
(
double
&
,
std
::
string
const
&
)
{}
};
struct
OutCD
{
void
eval
(
double
&
,
char
&
)
{}
};
struct
InCSOutIU
{
void
eval
(
char
const
&
,
unsigned
&
,
std
::
string
const
&
,
int
&
);
};
struct
InIU
{
void
eval
(
unsigned
const
&
,
int
const
&
);
};
}
// namespace TestCheckEvalOrderRT
TEST
(
ProcessLib_Graph_CheckEvalOrderRT
,
Success
)
{
using
namespace
TestCheckEvalOrderRT
;
{
using
Models
=
std
::
tuple
<
NoOp
>
;
using
Inputs
=
std
::
tuple
<>
;
ASSERT_TRUE
(
(
ProcessLib
::
Graph
::
isEvalOrderCorrectRT
<
Models
,
Inputs
>
()));
}
{
using
Models
=
std
::
tuple
<
OutD
>
;
using
Inputs
=
std
::
tuple
<>
;
ASSERT_TRUE
(
(
ProcessLib
::
Graph
::
isEvalOrderCorrectRT
<
Models
,
Inputs
>
()));
}
{
using
Models
=
std
::
tuple
<
InD
>
;
using
Inputs
=
std
::
tuple
<
double
>
;
ASSERT_TRUE
(
(
ProcessLib
::
Graph
::
isEvalOrderCorrectRT
<
Models
,
Inputs
>
()));
}
{
using
Models
=
std
::
tuple
<
OutD
,
InD
>
;
using
Inputs
=
std
::
tuple
<>
;
ASSERT_TRUE
(
(
ProcessLib
::
Graph
::
isEvalOrderCorrectRT
<
Models
,
Inputs
>
()));
}
{
using
Models
=
std
::
tuple
<
InSOutD
,
NoOp
,
InD
>
;
using
Inputs
=
std
::
tuple
<
std
::
string
>
;
ASSERT_TRUE
(
(
ProcessLib
::
Graph
::
isEvalOrderCorrectRT
<
Models
,
Inputs
>
()));
}
{
using
Models
=
std
::
tuple
<
OutCD
,
NoOp
,
InCSOutIU
,
InD
,
InIU
>
;
using
Inputs
=
std
::
tuple
<
std
::
string
>
;
ASSERT_TRUE
(
(
ProcessLib
::
Graph
::
isEvalOrderCorrectRT
<
Models
,
Inputs
>
()));
}
{
using
Models
=
std
::
tuple
<
NoOp
,
OutCD
,
InD
,
InCSOutIU
,
InIU
>
;
using
Inputs
=
std
::
tuple
<
std
::
string
>
;
ASSERT_TRUE
(
(
ProcessLib
::
Graph
::
isEvalOrderCorrectRT
<
Models
,
Inputs
>
()));
}
}
TEST
(
ProcessLib_Graph_CheckEvalOrderRT
,
Fail
)
{
using
namespace
TestCheckEvalOrderRT
;
{
using
Models
=
std
::
tuple
<
InD
>
;
using
Inputs
=
std
::
tuple
<>
;
ASSERT_FALSE
(
(
ProcessLib
::
Graph
::
isEvalOrderCorrectRT
<
Models
,
Inputs
>
()))
<<
"Expected to fail since the required double value is not "
"provided as an input."
;
}
{
using
Models
=
std
::
tuple
<
InD
,
OutD
>
;
using
Inputs
=
std
::
tuple
<>
;
ASSERT_FALSE
(
(
ProcessLib
::
Graph
::
isEvalOrderCorrectRT
<
Models
,
Inputs
>
()))
<<
"Expected to fail: double value is consumed before being "
"computed."
;
}
{
using
Models
=
std
::
tuple
<
NoOp
,
InSOutD
,
OutD
,
InD
>
;
using
Inputs
=
std
::
tuple
<
std
::
string
>
;
ASSERT_FALSE
(
(
ProcessLib
::
Graph
::
isEvalOrderCorrectRT
<
Models
,
Inputs
>
()))
<<
"Expected to fail: double value has two producers."
;
}
{
using
Models
=
std
::
tuple
<
OutCD
,
InIU
,
NoOp
,
InCSOutIU
,
InD
>
;
using
Inputs
=
std
::
tuple
<
std
::
string
>
;
ASSERT_FALSE
(
(
ProcessLib
::
Graph
::
isEvalOrderCorrectRT
<
Models
,
Inputs
>
()))
<<
"Expected to fail: wrong evaluation order."
;
}
{
using
Models
=
std
::
tuple
<
NoOp
,
OutCD
,
InD
,
OutD
,
InCSOutIU
,
InIU
>
;
using
Inputs
=
std
::
tuple
<
std
::
string
>
;
ASSERT_FALSE
(
(
ProcessLib
::
Graph
::
isEvalOrderCorrectRT
<
Models
,
Inputs
>
()))
<<
"Expected to fail: double value has two producers."
;
}
}
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