Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
108 commits
Select commit Hold shift + click to select a range
b504830
add junit to the project
fsb4000 Dec 17, 2018
c435608
create class Parameters
fsb4000 Dec 18, 2018
3905e47
add final to some variables
fsb4000 Dec 18, 2018
4034a36
add class Solver
fsb4000 Dec 18, 2018
0f75925
add multiply row to constant manipulation
fsb4000 Dec 18, 2018
f3aa754
add Subtract One row from another row manipulation
fsb4000 Dec 18, 2018
3b1ad41
add verbose mode
fsb4000 Dec 18, 2018
d63824f
refactoring
fsb4000 Dec 18, 2018
c6fa7ef
add verbose to Parameters
fsb4000 Dec 18, 2018
280fba1
add acceptance test and Main class
fsb4000 Dec 18, 2018
d9fe372
refactoring
fsb4000 Dec 20, 2018
90bf840
handle most special cases
fsb4000 Dec 20, 2018
b26b7e2
add general solution
fsb4000 Dec 20, 2018
aac53e0
refactoring
fsb4000 Dec 20, 2018
8f718a8
add complex numbers
fsb4000 Dec 28, 2018
4175cf0
refactoring
fsb4000 Dec 28, 2018
b19895f
rename a method
fsb4000 Dec 28, 2018
0d15262
replace epsilon comparations with equals method
fsb4000 Dec 28, 2018
73b0c25
reduced length of very long lines in some tests
fsb4000 Dec 28, 2018
79b15c0
refactoring
fsb4000 Dec 28, 2018
88b515a
reduced length of very long lines in some tests
fsb4000 Dec 28, 2018
b2ae010
fix Complex::equals method
fsb4000 Dec 28, 2018
ad30134
refactor Solver::solve method
fsb4000 Dec 28, 2018
e56b94d
fix solution after refactoring
fsb4000 Dec 28, 2018
fa90fca
refactor printSolutionInternal method
fsb4000 Dec 28, 2018
2eb69b8
add final to some variables
fsb4000 Dec 28, 2018
1a83bc3
acceptance tests checks the program stdout too
fsb4000 Dec 29, 2018
f76be5f
refactoring
fsb4000 Dec 29, 2018
b60afc4
refactoring
fsb4000 Dec 29, 2018
be69c60
add explicit type for 'areEqual' variable
fsb4000 Dec 29, 2018
c1dc06c
add ability run acceptance tests on Linux
fsb4000 Dec 29, 2018
a73df1a
refactoring
fsb4000 Dec 29, 2018
1d7420e
change name to more clear
fsb4000 Dec 29, 2018
4c822aa
refactoring
fsb4000 Jan 2, 2019
a727369
refactoring
fsb4000 Jan 2, 2019
e6f66cb
refactoring
fsb4000 Jan 2, 2019
e91062a
add Typescript port
fsb4000 Jan 2, 2019
2a2b033
ignore package-lock.json
fsb4000 Jan 2, 2019
8667c39
refactoring
fsb4000 Jan 2, 2019
8b78a09
delete unneeded package
fsb4000 Jan 2, 2019
764c82e
ignore some output files
fsb4000 Jan 3, 2019
2945224
allow run tests from any folder
fsb4000 Jan 3, 2019
6acd1af
typescript version: allow multiple delimiters
fsb4000 Jan 3, 2019
f627405
add more tests
fsb4000 Jan 4, 2019
a6c3705
refactoring
fsb4000 Jan 5, 2019
2d10a7f
prepare for C++ port
fsb4000 Jan 5, 2019
279437d
add C++ port
fsb4000 Jan 5, 2019
82a69b5
add test about complex number format
fsb4000 Jan 5, 2019
727692d
C++ refactoring
fsb4000 Jan 6, 2019
36edfed
C++: add linux support
fsb4000 Jan 6, 2019
6510a47
C++: add FreeBSD support
fsb4000 Jan 6, 2019
d2e2cac
add more tests to Complex parse
fsb4000 Jan 6, 2019
7fcbcc9
refactoring
fsb4000 Jan 6, 2019
d6004f1
update sanity checking scripts
fsb4000 Jan 6, 2019
3e6bed0
more 32 bit compatibility
fsb4000 Jan 6, 2019
2ed4261
add more test about validation input data
fsb4000 Jan 6, 2019
6dd20f5
add OpenIndiana support
fsb4000 Jan 6, 2019
bb7cc93
C++: add OpenBSD support
fsb4000 Jan 7, 2019
c0adacd
C++: add NetBSD support
fsb4000 Jan 6, 2019
ab7803f
C++: add DragonFlyBSD support
fsb4000 Jan 7, 2019
01d84fd
C++: add Haiku port
fsb4000 Jan 7, 2019
4181dea
refactoring
fsb4000 Jan 8, 2019
8c1cbb7
add Vala port
fsb4000 Jan 8, 2019
4eed948
refactoring
fsb4000 Jan 8, 2019
6353fe7
refactoring
fsb4000 Jan 8, 2019
2bd7371
Vala: add Linux support
fsb4000 Jan 8, 2019
9ba13ec
Vala: add FreeBSD support
fsb4000 Jan 8, 2019
0b06425
Vala: add OpenIndiana support
fsb4000 Jan 8, 2019
09eda1a
Vala: add OpenBSD support
fsb4000 Jan 8, 2019
474859b
Vala: add NetBSD support
fsb4000 Jan 8, 2019
bbd973f
Vala: add DragonFlyBSD support
fsb4000 Jan 9, 2019
644e6ec
Vala: add Haiku support
fsb4000 Jan 9, 2019
a9e458b
allow tab as delimiter
fsb4000 Jan 9, 2019
9ea69a3
add test
fsb4000 Jan 9, 2019
3e9103a
don't allow 0 as linear equations size
fsb4000 Jan 9, 2019
96a8f0f
refactoring
fsb4000 Jan 10, 2019
9725284
add initial C port
fsb4000 Jan 10, 2019
7096eab
add C program and acceptance tests
fsb4000 Jan 11, 2019
d4b978c
refactoring
fsb4000 Jan 11, 2019
c4a1256
refactoring
fsb4000 Jan 11, 2019
bd3169f
refactoring
fsb4000 Jan 11, 2019
cae16cb
refactoring
fsb4000 Jan 11, 2019
86c42c3
refactoring
fsb4000 Jan 11, 2019
00eda17
fix submodules in Linux
fsb4000 Jan 11, 2019
c118963
refactoring
fsb4000 Jan 11, 2019
caa81bb
C: add Linux support
fsb4000 Jan 11, 2019
c249b29
C: add support OpenIndiana
fsb4000 Jan 11, 2019
7622c6e
C: add FreeBSD support
fsb4000 Jan 11, 2019
0d28e21
C: add NetBSD support
fsb4000 Jan 11, 2019
de30293
C++: fix coredump on DragonFly BSD
fsb4000 Jan 12, 2019
202ff9f
C: add DragonFly BSD support
fsb4000 Jan 12, 2019
73b8526
C: add Haiku support
fsb4000 Jan 12, 2019
bbc2821
C: add OpenBSD support
fsb4000 Jan 12, 2019
2793d4d
C: prepare for DOS support
fsb4000 Jan 12, 2019
57eac4c
add DOS support for C and C++
fsb4000 Jan 14, 2019
a82b471
Save OpenWatcom make file for future use
fsb4000 Jan 14, 2019
e7bf4cb
DOS: change arch to i386 and generate debug symbols
fsb4000 Jan 15, 2019
1152490
correct way to build i386 binaries
fsb4000 Jan 15, 2019
82701ed
build C++ Boos Tests under DOS
fsb4000 Jan 16, 2019
e603cc4
return copy of arrays instead original arrays
fsb4000 Jan 16, 2019
14ad8d7
add C# port
fsb4000 Jan 17, 2019
4b4b80c
add PVS analyzer
fsb4000 Jan 18, 2019
1a64c76
add more tests
fsb4000 Jan 18, 2019
c7f36d3
update Java to 11.0.2
fsb4000 Jan 24, 2019
2f11faa
fix bug, thanks aaaaaa2493
fsb4000 Jan 24, 2019
5da9187
allow omit +-1 before i
fsb4000 Jan 25, 2019
35d33d3
add PVS-Studio for Java
fsb4000 Jan 26, 2019
aba3fcb
fix some warnings
fsb4000 Jan 31, 2019
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
46 changes: 42 additions & 4 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,10 +1,51 @@
# Compiled class file
*.class
out/
Java/out/
Java/.idea/workspace.xml
Java/.PVS-Studio/

# Log file
*.log

# Javascript files
*.js

# C++ generated files and folders
.vs/
*.d
*.o
x64/
Release/
Debug/
*.user
*.orig
C++/bin/
drd.txt
helgrind.txt
valgrind.txt
report/

# C generated files and folders
C/bin/

# C# generated files and folders
DotNET/packages/

# Vala generated files and folders
Vala/bin/
Vala/src/*.c
Vala/test/*.c

# Test accestance output files
out*.txt
stdout*.txt

# node_modules
Typescript/node_modules/

# package-lock
Typescript/package-lock.json

# BlueJ files
*.ctxt

Expand All @@ -25,6 +66,3 @@ hs_err_pid*

# Git
git.properties

# IntelliJ IDEA folder
.idea/
9 changes: 9 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
[submodule "C/3rd/unity"]
path = C/3rd/unity
url = https://github.com/ThrowTheSwitch/Unity
[submodule "C/3rd/useful-c-macros"]
path = C/3rd/useful-c-macros
url = https://github.com/fsb4000/useful-c-macros
[submodule "C++/3rd/useful-c-macros"]
path = C++/3rd/useful-c-macros
url = https://github.com/fsb4000/useful-c-macros
6 changes: 0 additions & 6 deletions .idea/misc.xml

This file was deleted.

10 changes: 0 additions & 10 deletions .idea/project.iml

This file was deleted.

23 changes: 23 additions & 0 deletions C++/.vscode/c_cpp_properties.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
{
"configurations": [
{
"name": "Win32",
"includePath": [
"${workspaceFolder}/**",
"C:/msys2/mingw64/include/**",
"C:/msys2/mingw64/lib/**"
],
"defines": [
"_DEBUG",
"UNICODE",
"_UNICODE"
],
"windowsSdkVersion": "10.0.17763.0",
"compilerPath": "C:/msys2/mingw64/bin/clang++.exe",
"cStandard": "c11",
"cppStandard": "c++17",
"intelliSenseMode": "clang-x64"
}
],
"version": 4
}
54 changes: 54 additions & 0 deletions C++/.vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
{
"C_Cpp.errorSquiggles": "Enabled",
"files.associations": {
"iosfwd": "cpp",
"cctype": "cpp",
"clocale": "cpp",
"cmath": "cpp",
"cstddef": "cpp",
"cstdio": "cpp",
"cstdlib": "cpp",
"cstring": "cpp",
"cwchar": "cpp",
"array": "cpp",
"strstream": "cpp",
"*.tcc": "cpp",
"complex": "cpp",
"cstdint": "cpp",
"list": "cpp",
"vector": "cpp",
"exception": "cpp",
"functional": "cpp",
"initializer_list": "cpp",
"iostream": "cpp",
"istream": "cpp",
"limits": "cpp",
"new": "cpp",
"optional": "cpp",
"ostream": "cpp",
"sstream": "cpp",
"stdexcept": "cpp",
"streambuf": "cpp",
"string_view": "cpp",
"system_error": "cpp",
"tuple": "cpp",
"type_traits": "cpp",
"typeinfo": "cpp",
"utility": "cpp",
"ctime": "cpp",
"cwctype": "cpp",
"atomic": "cpp",
"bitset": "cpp",
"chrono": "cpp",
"cinttypes": "cpp",
"deque": "cpp",
"unordered_map": "cpp",
"fstream": "cpp",
"memory": "cpp",
"numeric": "cpp",
"ratio": "cpp",
"thread": "cpp",
"typeindex": "cpp",
"variant": "cpp"
}
}
1 change: 1 addition & 0 deletions C++/3rd/useful-c-macros
Submodule useful-c-macros added at 647294
4 changes: 4 additions & 0 deletions C++/acceptance tests/in.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
3 3
1 1 2 9
2 4 -3 1
3 6 -5 0
5 changes: 5 additions & 0 deletions C++/acceptance tests/in1.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
3 4
0 1 2 9
0 1 3 1
1 0 6 0
2 0 2 0
5 changes: 5 additions & 0 deletions C++/acceptance tests/in2.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
4 4
1 0 0 5 0
0 0 0 0 0
0 0 1 4 6
0 0 5 5 5
4 changes: 4 additions & 0 deletions C++/acceptance tests/in3.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
3 3
1+2i -1.5-1.1i 2.12 91+5i
-1+3i 1.2+3.5i -3.3 1+15i
12.31 1.3-5i 12.3i -78.3i
89 changes: 89 additions & 0 deletions C++/acceptance tests/tests.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,89 @@
#!/usr/bin/env pwsh
Describe CppAcceptanceTests {
It 'single solution' {
Remove-Item "$PSScriptRoot/out.txt" -ErrorAction SilentlyContinue
Remove-Item "$PSScriptRoot/stdout.txt" -ErrorAction SilentlyContinue

& "$PSScriptRoot/../bin/solution_cpp" -in "$PSScriptRoot/in.txt" -out "$PSScriptRoot/out.txt" -verbose > "$PSScriptRoot/stdout.txt"

[String[]]$lines = [System.IO.File]::ReadLines("$PSScriptRoot/out.txt")
$lines.Count | Should Be 1
$lines[0] | Should Be "(1, 2, 3)"

[String[]]$stdoutLines = [System.IO.File]::ReadLines("$PSScriptRoot/stdout.txt")
[String[]]$expectedOutput = [String[]]("Start solving the equation.",
"Rows manipulation:", "-2 * R1 +R2 -> R2", "-3 * R1 +R3 -> R3",
"R2 / 2 -> R2", "-3 * R2 +R3 -> R3", "R3 / -0.5 -> R3",
"3.5 * R3 +R2 -> R2", "-2 * R3 +R1 -> R1", "-1 * R2 +R1 -> R1",
"(1, 2, 3)", "Saved to file $PSScriptRoot/out.txt")
[bool]$areEqual = @(Compare-Object $expectedOutput $stdoutLines -SyncWindow 0).Length -eq 0
$areEqual | Should Be $true
}

It 'no solution' {
Remove-Item "$PSScriptRoot/out1.txt" -ErrorAction SilentlyContinue
Remove-Item "$PSScriptRoot/stdout1.txt" -ErrorAction SilentlyContinue

& "$PSScriptRoot/../bin/solution_cpp" -in "$PSScriptRoot/in1.txt" -out "$PSScriptRoot/out1.txt" -verbose > "$PSScriptRoot/stdout1.txt"

[String[]]$lines = [System.IO.File]::ReadLines("$PSScriptRoot/out1.txt")
$lines.Count | Should Be 1
$lines[0] | Should Be "There are no solutions"

[String[]]$stdoutLines = [System.IO.File]::ReadLines("$PSScriptRoot/stdout1.txt")
[String[]]$expectedOutput = [String[]]("Start solving the equation.",
"Rows manipulation:", "R1 <-> R3", "-1 * R2 +R3 -> R3", "R3 / -1 -> R3",
"-3 * R3 +R2 -> R2", "-6 * R3 +R1 -> R1", "There are no solutions", "Saved to file $PSScriptRoot/out1.txt")
[bool]$areEqual = @(Compare-Object $expectedOutput $stdoutLines -SyncWindow 0).Length -eq 0
$areEqual | Should Be $true
}

It 'many solutions' {
Remove-Item "$PSScriptRoot/out2.txt" -ErrorAction SilentlyContinue
Remove-Item "$PSScriptRoot/stdout2.txt" -ErrorAction SilentlyContinue

& "$PSScriptRoot/../bin/solution_cpp" -in "$PSScriptRoot/in2.txt" -out "$PSScriptRoot/out2.txt" -verbose > "$PSScriptRoot/stdout2.txt"

[String[]]$lines = [System.IO.File]::ReadLines("$PSScriptRoot/out2.txt")
$lines.Count | Should Be 1
$lines[0] | Should Be "(-8.3333, x2, -0.6667, 1.6667)"

[String[]]$stdoutLines = [System.IO.File]::ReadLines("$PSScriptRoot/stdout2.txt")
[String[]]$expectedOutput = [String[]]("Start solving the equation.",
"Rows manipulation:", "C3 <-> C2", "R3 <-> R2", "-5 * R2 +R4 -> R4",
"C4 <-> C3", "R4 <-> R3", "R3 / -15 -> R3", "-4 * R3 +R2 -> R2",
"-5 * R3 +R1 -> R1", "(-8.3333, x2, -0.6667, 1.6667)","Saved to file $PSScriptRoot/out2.txt")
[bool]$areEqual = @(Compare-Object $expectedOutput $stdoutLines -SyncWindow 0).Length -eq 0
$areEqual | Should Be $true
}

It 'single solution complex numbers' {
Remove-Item "$PSScriptRoot/out3.txt" -ErrorAction SilentlyContinue
Remove-Item "$PSScriptRoot/stdout3.txt" -ErrorAction SilentlyContinue

& "$PSScriptRoot/../bin/solution_cpp" -in "$PSScriptRoot/in3.txt" -out "$PSScriptRoot/out3.txt" -verbose > "$PSScriptRoot/stdout3.txt"

[String[]]$lines = [System.IO.File]::ReadLines("$PSScriptRoot/out3.txt")
$lines.Count | Should Be 1
$lines[0] | Should Be "(6.7334-22.9975i, -1.7976+2.084i, 15.6994+7.396i)"

[String[]]$stdoutLines = [System.IO.File]::ReadLines("$PSScriptRoot/stdout3.txt")
[String[]]$expectedOutput = [String[]]("Start solving the equation.",
"Rows manipulation:", "R1 / 1+2i -> R1", "1-3i * R1 +R2 -> R2", "-12.31 * R1 +R3 -> R3",
"R2 / 1.6+6.1i -> R2", "-10.4094+9.6778i * R2 +R3 -> R3", "R3 / -6.7848+9.7158i -> R3",
"0.5432-0.746i * R3 +R2 -> R2", "-0.424+0.848i * R3 +R1 -> R1", "0.74-0.38i * R2 +R1 -> R1",
"(6.7334-22.9975i, -1.7976+2.084i, 15.6994+7.396i)", "Saved to file $PSScriptRoot/out3.txt")
[bool]$areEqual = @(Compare-Object $expectedOutput $stdoutLines -SyncWindow 0).Length -eq 0
$areEqual | Should Be $true
}

It 'no output without -verbose' {
Remove-Item "$PSScriptRoot/out4.txt" -ErrorAction SilentlyContinue
Remove-Item "$PSScriptRoot/stdout4.txt" -ErrorAction SilentlyContinue

& "$PSScriptRoot/../bin/solution_cpp" -in "$PSScriptRoot/in.txt" -out "$PSScriptRoot/out4.txt" > "$PSScriptRoot/stdout4.txt"

[String[]]$stdoutLines = [System.IO.File]::ReadLines("$PSScriptRoot/stdout4.txt")
$stdoutLines.Count | Should Be 0
}
}
88 changes: 88 additions & 0 deletions C++/acceptance tests/tests_win.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,88 @@
Describe CppAcceptanceTests {
It 'single solution' {
Remove-Item "$PSScriptRoot/out.txt" -ErrorAction SilentlyContinue
Remove-Item "$PSScriptRoot/stdout.txt" -ErrorAction SilentlyContinue

& "$PSScriptRoot/../msvc2017/Test/Release/Solution.exe" -in "$PSScriptRoot/in.txt" -out "$PSScriptRoot/out.txt" -verbose > "$PSScriptRoot/stdout.txt"

[String[]]$lines = [System.IO.File]::ReadLines("$PSScriptRoot/out.txt")
$lines.Count | Should Be 1
$lines[0] | Should Be "(1, 2, 3)"

[String[]]$stdoutLines = [System.IO.File]::ReadLines("$PSScriptRoot/stdout.txt")
[String[]]$expectedOutput = [String[]]("Start solving the equation.",
"Rows manipulation:", "-2 * R1 +R2 -> R2", "-3 * R1 +R3 -> R3",
"R2 / 2 -> R2", "-3 * R2 +R3 -> R3", "R3 / -0.5 -> R3",
"3.5 * R3 +R2 -> R2", "-2 * R3 +R1 -> R1", "-1 * R2 +R1 -> R1",
"(1, 2, 3)", "Saved to file $PSScriptRoot/out.txt")
[bool]$areEqual = @(Compare-Object $expectedOutput $stdoutLines -SyncWindow 0).Length -eq 0
$areEqual | Should Be $true
}

It 'no solution' {
Remove-Item "$PSScriptRoot/out1.txt" -ErrorAction SilentlyContinue
Remove-Item "$PSScriptRoot/stdout1.txt" -ErrorAction SilentlyContinue

& "$PSScriptRoot/../msvc2017/Test/Release/Solution.exe" -in "$PSScriptRoot/in1.txt" -out "$PSScriptRoot/out1.txt" -verbose > "$PSScriptRoot/stdout1.txt"

[String[]]$lines = [System.IO.File]::ReadLines("$PSScriptRoot/out1.txt")
$lines.Count | Should Be 1
$lines[0] | Should Be "There are no solutions"

[String[]]$stdoutLines = [System.IO.File]::ReadLines("$PSScriptRoot/stdout1.txt")
[String[]]$expectedOutput = [String[]]("Start solving the equation.",
"Rows manipulation:", "R1 <-> R3", "-1 * R2 +R3 -> R3", "R3 / -1 -> R3",
"-3 * R3 +R2 -> R2", "-6 * R3 +R1 -> R1", "There are no solutions", "Saved to file $PSScriptRoot/out1.txt")
[bool]$areEqual = @(Compare-Object $expectedOutput $stdoutLines -SyncWindow 0).Length -eq 0
$areEqual | Should Be $true
}

It 'many solutions' {
Remove-Item "$PSScriptRoot/out2.txt" -ErrorAction SilentlyContinue
Remove-Item "$PSScriptRoot/stdout2.txt" -ErrorAction SilentlyContinue

& "$PSScriptRoot/../msvc2017/Test/Release/Solution.exe" -in "$PSScriptRoot/in2.txt" -out "$PSScriptRoot/out2.txt" -verbose > "$PSScriptRoot/stdout2.txt"

[String[]]$lines = [System.IO.File]::ReadLines("$PSScriptRoot/out2.txt")
$lines.Count | Should Be 1
$lines[0] | Should Be "(-8.3333, x2, -0.6667, 1.6667)"

[String[]]$stdoutLines = [System.IO.File]::ReadLines("$PSScriptRoot/stdout2.txt")
[String[]]$expectedOutput = [String[]]("Start solving the equation.",
"Rows manipulation:", "C3 <-> C2", "R3 <-> R2", "-5 * R2 +R4 -> R4",
"C4 <-> C3", "R4 <-> R3", "R3 / -15 -> R3", "-4 * R3 +R2 -> R2",
"-5 * R3 +R1 -> R1", "(-8.3333, x2, -0.6667, 1.6667)","Saved to file $PSScriptRoot/out2.txt")
[bool]$areEqual = @(Compare-Object $expectedOutput $stdoutLines -SyncWindow 0).Length -eq 0
$areEqual | Should Be $true
}

It 'single solution complex numbers' {
Remove-Item "$PSScriptRoot/out3.txt" -ErrorAction SilentlyContinue
Remove-Item "$PSScriptRoot/stdout3.txt" -ErrorAction SilentlyContinue

& "$PSScriptRoot/../msvc2017/Test/Release/Solution.exe" -in "$PSScriptRoot/in3.txt" -out "$PSScriptRoot/out3.txt" -verbose > "$PSScriptRoot/stdout3.txt"

[String[]]$lines = [System.IO.File]::ReadLines("$PSScriptRoot/out3.txt")
$lines.Count | Should Be 1
$lines[0] | Should Be "(6.7334-22.9975i, -1.7976+2.084i, 15.6994+7.396i)"

[String[]]$stdoutLines = [System.IO.File]::ReadLines("$PSScriptRoot/stdout3.txt")
[String[]]$expectedOutput = [String[]]("Start solving the equation.",
"Rows manipulation:", "R1 / 1+2i -> R1", "1-3i * R1 +R2 -> R2", "-12.31 * R1 +R3 -> R3",
"R2 / 1.6+6.1i -> R2", "-10.4094+9.6778i * R2 +R3 -> R3", "R3 / -6.7848+9.7158i -> R3",
"0.5432-0.746i * R3 +R2 -> R2", "-0.424+0.848i * R3 +R1 -> R1", "0.74-0.38i * R2 +R1 -> R1",
"(6.7334-22.9975i, -1.7976+2.084i, 15.6994+7.396i)", "Saved to file $PSScriptRoot/out3.txt")
[bool]$areEqual = @(Compare-Object $expectedOutput $stdoutLines -SyncWindow 0).Length -eq 0
$areEqual | Should Be $true
}

It 'no output without -verbose' {
Remove-Item "$PSScriptRoot/out4.txt" -ErrorAction SilentlyContinue
Remove-Item "$PSScriptRoot/stdout4.txt" -ErrorAction SilentlyContinue

& "$PSScriptRoot/../msvc2017/Test/Release/Solution.exe" -in "$PSScriptRoot/in.txt" -out "$PSScriptRoot/out4.txt" > "$PSScriptRoot/stdout4.txt"

[String[]]$stdoutLines = [System.IO.File]::ReadLines("$PSScriptRoot/stdout4.txt")
$stdoutLines.Count | Should Be 0
}
}
1 change: 1 addition & 0 deletions C++/analyze.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
/usr/local/llvm60/bin/scan-build -o ./report/ gmake
Empty file added C++/bin/.do_not_delete.txt
Empty file.
12 changes: 12 additions & 0 deletions C++/drd.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
OS="`uname`"
case $OS in
'Linux')
alias make='make'
;;
'FreeBSD')
alias make='gmake'
;;
*) ;;
esac

make clean && VALGRIND=1 make && valgrind --log-file=drd.txt --read-var-info=yes --tool=drd bin/test_cpp
Loading