Google OR-Tools
v9.12
a fast and portable software suite for combinatorial optimization
Loading...
Searching...
No Matches
InitTests.cs
Go to the documentation of this file.
1
// Copyright 2010-2025 Google LLC
2
// Licensed under the Apache License, Version 2.0 (the "License");
3
// you may not use this file except in compliance with the License.
4
// You may obtain a copy of the License at
5
//
6
// http://www.apache.org/licenses/LICENSE-2.0
7
//
8
// Unless required by applicable law or agreed to in writing, software
9
// distributed under the License is distributed on an "AS IS" BASIS,
10
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
11
// See the License for the specific language governing permissions and
12
// limitations under the License.
13
14
using
System;
15
using
Xunit;
16
using
Google.OrTools.Init
;
17
using
static
Google
.
OrTools
.
Init
.
operations_research_init
;
18
19
namespace
Google.OrTools.Tests
20
{
21
public
class
InitTest
22
{
23
[Fact]
24
public
void
CheckLogging
()
25
{
26
Init
.
CppBridge
.
InitLogging
(
"init"
);
27
Init
.
CppBridge
.
ShutdownLogging
();
28
}
29
30
[Fact]
31
public
void
CheckFlags
()
32
{
33
Init.CppFlags
cpp_flags =
new
Init
.
CppFlags
();
34
cpp_flags.stderrthreshold = 0;
35
cpp_flags.log_prefix =
true
;
36
cpp_flags.cp_model_dump_prefix =
"init"
;
37
cpp_flags.cp_model_dump_models =
true
;
38
cpp_flags.cp_model_dump_submodels =
true
;
39
cpp_flags.cp_model_dump_response =
true
;
40
Init
.
CppBridge
.
SetFlags
(cpp_flags);
41
}
42
43
[Fact]
44
public
void
CheckOrToolsVersion
()
45
{
46
int
major =
OrToolsVersion
.
MajorNumber
();
47
int
minor =
OrToolsVersion
.
MinorNumber
();
48
int
patch =
OrToolsVersion
.
PatchNumber
();
49
string
version =
OrToolsVersion
.
VersionString
();
50
Assert.Equal($
"{major}.{minor}.{patch}"
, version);
51
}
52
}
53
}
// namespace Google.OrTools.Tests
Google.OrTools.Init.CppBridge
Definition
CppBridge.cs:15
Google.OrTools.Init.CppBridge.ShutdownLogging
static void ShutdownLogging()
Definition
CppBridge.cs:67
Google.OrTools.Init.CppBridge.SetFlags
static void SetFlags(CppFlags flags)
Definition
CppBridge.cs:71
Google.OrTools.Init.CppBridge.InitLogging
static void InitLogging(string usage)
Definition
CppBridge.cs:62
Google.OrTools.Init.CppFlags
Definition
CppFlags.cs:15
Google.OrTools.Init.OrToolsVersion
Definition
OrToolsVersion.cs:15
Google.OrTools.Init.OrToolsVersion.VersionString
static string VersionString()
Definition
OrToolsVersion.cs:77
Google.OrTools.Init.OrToolsVersion.MajorNumber
static int MajorNumber()
Definition
OrToolsVersion.cs:62
Google.OrTools.Init.OrToolsVersion.PatchNumber
static int PatchNumber()
Definition
OrToolsVersion.cs:72
Google.OrTools.Init.OrToolsVersion.MinorNumber
static int MinorNumber()
Definition
OrToolsVersion.cs:67
Google.OrTools.Init.operations_research_init
Definition
operations_research_init.cs:15
Google.OrTools.Tests.InitTest
Definition
InitTests.cs:22
Google.OrTools.Tests.InitTest.CheckFlags
void CheckFlags()
Definition
InitTests.cs:31
Google.OrTools.Tests.InitTest.CheckLogging
void CheckLogging()
Definition
InitTests.cs:24
Google.OrTools.Tests.InitTest.CheckOrToolsVersion
void CheckOrToolsVersion()
Definition
InitTests.cs:44
Google.OrTools.Init
Definition
CppBridge.cs:13
Google.OrTools.Tests
Definition
KnapsackSolverTests.cs:19
Google.OrTools
Definition
KnapsackSolverTests.cs:19
Google
Definition
KnapsackSolverTests.cs:19
ortools
init
csharp
InitTests.cs
Generated by
1.13.2