now it's not a single project, but a solution

This commit is contained in:
Timerix22 2022-01-14 00:12:40 +03:00
parent 97269fd160
commit fe35153278
122 changed files with 6636 additions and 0 deletions

31
DTLib.sln Normal file
View File

@ -0,0 +1,31 @@

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio Version 17
VisualStudioVersion = 17.0.32014.148
MinimumVisualStudioVersion = 10.0.40219.1
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "DTLib", "DTLib\DTLib.csproj", "{B620E5E9-800F-4B2D-B4A5-062E05DB704F}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "TestProgram", "TestProgram\TestProgram.csproj", "{72BA37EF-07EC-4D34-966A-20D5E83ADB32}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Release|Any CPU = Release|Any CPU
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{B620E5E9-800F-4B2D-B4A5-062E05DB704F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{B620E5E9-800F-4B2D-B4A5-062E05DB704F}.Debug|Any CPU.Build.0 = Debug|Any CPU
{B620E5E9-800F-4B2D-B4A5-062E05DB704F}.Release|Any CPU.ActiveCfg = Release|Any CPU
{B620E5E9-800F-4B2D-B4A5-062E05DB704F}.Release|Any CPU.Build.0 = Release|Any CPU
{72BA37EF-07EC-4D34-966A-20D5E83ADB32}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{72BA37EF-07EC-4D34-966A-20D5E83ADB32}.Debug|Any CPU.Build.0 = Debug|Any CPU
{72BA37EF-07EC-4D34-966A-20D5E83ADB32}.Release|Any CPU.ActiveCfg = Release|Any CPU
{72BA37EF-07EC-4D34-966A-20D5E83ADB32}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {6D0413D6-AF96-46C3-9E67-858AE2482818}
EndGlobalSection
EndGlobal

View File

View File

@ -0,0 +1,89 @@
using System.Threading;
using DTLib.Dtsod;
using DTLib.Experimental;
using static TestProgram.Program;
namespace TestProgram.DtsodV2X;
public static class TestDtsodV23
{
public static void TestAll()
{
TestBaseTypes();
TestLists();
TestComplexes();
TestReSerialization();
TestSpeed();
TestMemoryConsumption();
}
public static void TestBaseTypes()
{
Info.Log("b", "[TestDtsodV23/TestBaseTypes]");
DtsodV23 dtsod = new(File.ReadAllText("DtsodV2X\\base_types.dtsod"));
foreach (var pair in dtsod)
Info.LogNoTime("b", pair.Value.GetType().Name + ' ', "w", pair.Key + ' ', "c", pair.Value.ToString());
Info.Log("g", "[test completed]");
}
public static void TestLists()
{
Info.Log("b", "[TestDtsodV23/TestLists]");
DtsodV23 dtsod = new(File.ReadAllText("DtsodV2X\\lists.dtsod"));
foreach (var pair in dtsod)
{
Info.LogNoTime("b", pair.Value.GetType().Name + ' ', "w", pair.Key, "c",
$" count: {pair.Value.Count}");
foreach (var el in pair.Value)
Info.LogNoTime("b", '\t'+el.GetType().Name + ' ', "c", el.ToString());
}
Info.Log("g", "[test completed]");
}
public static void TestComplexes()
{
Info.Log("b", "[TestDtsodV23/TestComplexes]");
DtsodV23 dtsod = new(File.ReadAllText("DtsodV2X\\complexes.dtsod"));
foreach (var pair in dtsod)
{
Info.LogNoTime("b", pair.Value.GetType().Name + ' ', "w", pair.Key,
"b", " length: ", "c", pair.Value.Keys.Count.ToString() + "\n\t",
"y", pair.Value.ToString().Replace("\n","\n\t"));
}
Info.Log("g", "[test completed]");
}
public static void TestReSerialization()
{
Info.Log("b", "[TestDtsodV23/TestReSerialization]");
DtsodV23 dtsod = new DtsodV23(new DtsodV23(new DtsodV23(
new DtsodV23(File.ReadAllText("DtsodV2X\\complexes.dtsod")).ToString()).ToString()).ToString());
Info.Log("y", dtsod.ToString());
Info.Log("g", "[test completed]");
}
public static void TestSpeed()
{
Info.Log("b", "[TestDtsodV23/TestSpeed]");
IDtsod dtsod=null;
string text = File.ReadAllText("DtsodV2X\\messages.dtsod");
Tester.LogOperationTime("V21 deserialization",100,()=>dtsod=new DtsodV21(text));
Tester.LogOperationTime("V21 serialization", 100, () => _=dtsod.ToString());
Tester.LogOperationTime("V23 deserialization", 100, () => dtsod = new DtsodV23(text));
Tester.LogOperationTime("V23 serialization", 100, () => _ = dtsod.ToString());
Info.Log("g", "[test completed]");
}
public static void TestMemoryConsumption()
{
Info.Log("b", "[TestDtsodV23/TestMemoryConsumption]");
string text = File.ReadAllText("DtsodV2X\\messages.dtsod");
var a = GC.GetTotalMemory(true);
DtsodV23[] dtsods = new DtsodV23[100];
for (int i = 0; i < dtsods.Length; i++)
dtsods[i] = new(text);
var b = GC.GetTotalMemory(true);
Info.Log("b", "at the start: ","c",$"{a/1024} kb\n",
"b", "at the end: ", "c", $"{b / 1024} kb\n{dtsods.Count()}","b"," dtsods initialized");
Info.Log("g", "[test completed]");
}
}

View File

@ -0,0 +1,14 @@
bool: false;
char: 'v';
byte: 255b;
sbyte: -125sb;
short: 14003s;
ushort: 32025us;
int: -2515;
uint: 0u;
long: -29863854396l;
ulong: 87659057946ul;
float: 39.944f;
double: 965.557;
decimal: -84.20de;
string: "_$\"\\\\'''\n\ta ûûû000;2;=:%d;```";

View File

@ -0,0 +1,9 @@
message:
{
type: "sent";
time: "15.12.2021 20:51:24 +03:00";
author_id: 293798876950036480ul;
channel_id: 913088838761603212ul;
message_id: 920734809096077353ul;
text: "_$\"\\\\'''\n\ta ыыы000;2;=:%d;```";
};

View File

@ -0,0 +1,4 @@
chars: ['a','b','c'];
uints: [10,20,30,0,0];
floats: [8.2,5.225,-0.9993];
strings:["aaa","bbb","ccc"];

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1 @@
nullable:null;

View File

@ -0,0 +1,14 @@
bool:b=false;
char:c='v';
string:s="hello";
byte:by=255;
sbyte:sb=-125;
short:sh=14003;
ushort:us=32025;
int:i=-2515;
uint:ui=0;
long:l=-29863854396;
ulong:ul=87659057946;
float:f=39.944;
double:do=965.557;
decimal:de=-84.20;

View File

@ -0,0 +1 @@
List<string>:list=[string:"a",string:"b"];

36
TestProgram/Program.cs Normal file
View File

@ -0,0 +1,36 @@
global using System;
global using System.Collections;
global using System.Collections.Generic;
global using System.Linq;
global using System.Text;
global using System.Threading.Tasks;
global using DTLib;
global using DTLib.Extensions;
global using DTLib.Filesystem;
using DTLib.Dtsod;
using DTLib.Loggers;
using TestProgram.DtsodV2X;
namespace TestProgram;
static class Program
{
public static DefaultLogger Info = new();
static public void Main()
{
Info.Enable();
PublicLog.LogEvent += Info.Log;
PublicLog.LogNoTimeEvent += Info.LogNoTime;
Console.OutputEncoding = Encoding.UTF8;
Console.InputEncoding = Encoding.UTF8;
Console.Title="tester";
try
{
TestDtsodV23.TestAll();
}
catch (Exception ex)
{ Info.Log("r", ex.ToString()); }
Console.ResetColor();
}
}

View File

@ -0,0 +1,24 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net6.0</TargetFramework>
<ImplicitUsings>false</ImplicitUsings>
<Nullable>disable</Nullable>
<DebugType>portable</DebugType>
<CheckForOverflowUnderflow>True</CheckForOverflowUnderflow>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
<StartupObject>TestProgram.Program</StartupObject>
<ProduceReferenceAssembly>False</ProduceReferenceAssembly>
</PropertyGroup>
<ItemGroup>
<ProjectReference Include="..\DTLib\DTLib.csproj" />
</ItemGroup>
<ItemGroup>
<None Update="DtsodV2X\*">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
<None Update="DtsodV30\*">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
</ItemGroup>
</Project>

Binary file not shown.

Binary file not shown.

View File

@ -0,0 +1,14 @@
bool: false;
char: 'v';
byte: 255b;
sbyte: -125sb;
short: 14003s;
ushort: 32025us;
int: -2515;
uint: 0u;
long: -29863854396l;
ulong: 87659057946ul;
float: 39.944f;
double: 965.557;
decimal: -84.20de;
string: "_$\"\\\\'''\n\ta ûûû000;2;=:%d;```";

View File

@ -0,0 +1,9 @@
message:
{
type: "sent";
time: "15.12.2021 20:51:24 +03:00";
author_id: 293798876950036480ul;
channel_id: 913088838761603212ul;
message_id: 920734809096077353ul;
text: "_$\"\\\\'''\n\ta ыыы000;2;=:%d;```";
};

View File

@ -0,0 +1,4 @@
chars: ['a','b','c'];
uints: [10,20,30,0,0];
floats: [8.2,5.225,-0.9993];
strings:["aaa","bbb","ccc"];

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1 @@
nullable:null;

View File

@ -0,0 +1,14 @@
bool:b=false;
char:c='v';
string:s="hello";
byte:by=255;
sbyte:sb=-125;
short:sh=14003;
ushort:us=32025;
int:i=-2515;
uint:ui=0;
long:l=-29863854396;
ulong:ul=87659057946;
float:f=39.944;
double:do=965.557;
decimal:de=-84.20;

View File

@ -0,0 +1 @@
List<string>:list=[string:"a",string:"b"];

View File

@ -0,0 +1,36 @@
{
"runtimeTarget": {
"name": ".NETCoreApp,Version=v6.0",
"signature": ""
},
"compilationOptions": {},
"targets": {
".NETCoreApp,Version=v6.0": {
"TestProgram/1.0.0": {
"dependencies": {
"DTLib": "1.0.0"
},
"runtime": {
"TestProgram.dll": {}
}
},
"DTLib/1.0.0": {
"runtime": {
"DTLib.dll": {}
}
}
}
},
"libraries": {
"TestProgram/1.0.0": {
"type": "project",
"serviceable": false,
"sha512": ""
},
"DTLib/1.0.0": {
"type": "project",
"serviceable": false,
"sha512": ""
}
}
}

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@ -0,0 +1,9 @@
{
"runtimeOptions": {
"tfm": "net6.0",
"framework": {
"name": "Microsoft.NETCore.App",
"version": "6.0.0"
}
}
}

Binary file not shown.

Binary file not shown.

View File

@ -0,0 +1,14 @@
bool: false;
char: 'v';
byte: 255b;
sbyte: -125sb;
short: 14003s;
ushort: 32025us;
int: -2515;
uint: 0u;
long: -29863854396l;
ulong: 87659057946ul;
float: 39.944f;
double: 965.557;
decimal: -84.20de;
string: "_$\"\\\\'''\n\ta ûûû000;2;=:%d;```";

View File

@ -0,0 +1,9 @@
message:
{
type: "sent";
time: "15.12.2021 20:51:24 +03:00";
author_id: 293798876950036480ul;
channel_id: 913088838761603212ul;
message_id: 920734809096077353ul;
text: "_$\"\\\\'''\n\ta ыыы000;2;=:%d;```";
};

View File

@ -0,0 +1,4 @@
chars: ['a','b','c'];
uints: [10,20,30,0,0];
floats: [8.2,5.225,-0.9993];
strings:["aaa","bbb","ccc"];

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1 @@
nullable:null;

View File

@ -0,0 +1,14 @@
bool:b=false;
char:c='v';
string:s="hello";
byte:by=255;
sbyte:sb=-125;
short:sh=14003;
ushort:us=32025;
int:i=-2515;
uint:ui=0;
long:l=-29863854396;
ulong:ul=87659057946;
float:f=39.944;
double:do=965.557;
decimal:de=-84.20;

View File

@ -0,0 +1 @@
List<string>:list=[string:"a",string:"b"];

View File

@ -0,0 +1,36 @@
{
"runtimeTarget": {
"name": ".NETCoreApp,Version=v6.0",
"signature": ""
},
"compilationOptions": {},
"targets": {
".NETCoreApp,Version=v6.0": {
"TestProgram/1.0.0": {
"dependencies": {
"DTLib": "1.0.0"
},
"runtime": {
"TestProgram.dll": {}
}
},
"DTLib/1.0.0": {
"runtime": {
"DTLib.dll": {}
}
}
}
},
"libraries": {
"TestProgram/1.0.0": {
"type": "project",
"serviceable": false,
"sha512": ""
},
"DTLib/1.0.0": {
"type": "project",
"serviceable": false,
"sha512": ""
}
}
}

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@ -0,0 +1,12 @@
{
"runtimeOptions": {
"tfm": "net6.0",
"framework": {
"name": "Microsoft.NETCore.App",
"version": "6.0.0"
},
"configProperties": {
"System.Reflection.Metadata.MetadataUpdater.IsSupported": false
}
}
}

View File

@ -0,0 +1,4 @@
// <autogenerated />
using System;
using System.Reflection;
[assembly: global::System.Runtime.Versioning.TargetFrameworkAttribute(".NETCoreApp,Version=v6.0", FrameworkDisplayName = "")]

View File

@ -0,0 +1,23 @@
//------------------------------------------------------------------------------
// <auto-generated>
// Этот код создан программой.
// Исполняемая версия:4.0.30319.42000
//
// Изменения в этом файле могут привести к неправильной работе и будут потеряны в случае
// повторной генерации кода.
// </auto-generated>
//------------------------------------------------------------------------------
using System;
using System.Reflection;
[assembly: System.Reflection.AssemblyCompanyAttribute("TestProgram")]
[assembly: System.Reflection.AssemblyConfigurationAttribute("Debug")]
[assembly: System.Reflection.AssemblyFileVersionAttribute("1.0.0.0")]
[assembly: System.Reflection.AssemblyInformationalVersionAttribute("1.0.0")]
[assembly: System.Reflection.AssemblyProductAttribute("TestProgram")]
[assembly: System.Reflection.AssemblyTitleAttribute("TestProgram")]
[assembly: System.Reflection.AssemblyVersionAttribute("1.0.0.0")]
// Создано классом WriteCodeFragment MSBuild.

View File

@ -0,0 +1 @@
50807496b7e03e652e948152d6f734ad8f046635

View File

@ -0,0 +1,10 @@
is_global = true
build_property.TargetFramework = net6.0
build_property.TargetPlatformMinVersion =
build_property.UsingMicrosoftNETSdkWeb =
build_property.ProjectTypeGuids =
build_property.InvariantGlobalization =
build_property.PlatformNeutralAssembly =
build_property._SupportedPlatformList = Linux,macOS,Windows
build_property.RootNamespace = TestProgram
build_property.ProjectDir = C:\projects\c#\DTLib\TestProgram\

Binary file not shown.

View File

@ -0,0 +1 @@
3fc818a7aa42b85417b1a9a4ad4c679fab7ccd44

View File

@ -0,0 +1,23 @@
C:\projects\c#\DTLib\TestProgram\obj\Debug\net6.0\TestProgram.csproj.AssemblyReference.cache
C:\projects\c#\DTLib\TestProgram\obj\Debug\net6.0\TestProgram.GeneratedMSBuildEditorConfig.editorconfig
C:\projects\c#\DTLib\TestProgram\obj\Debug\net6.0\TestProgram.AssemblyInfoInputs.cache
C:\projects\c#\DTLib\TestProgram\obj\Debug\net6.0\TestProgram.AssemblyInfo.cs
C:\projects\c#\DTLib\TestProgram\obj\Debug\net6.0\TestProgram.csproj.CoreCompileInputs.cache
C:\projects\c#\DTLib\TestProgram\bin\Debug\net6.0\TestProgram.exe
C:\projects\c#\DTLib\TestProgram\bin\Debug\net6.0\DtsodV2X\base_types.dtsod
C:\projects\c#\DTLib\TestProgram\bin\Debug\net6.0\DtsodV2X\lists.dtsod
C:\projects\c#\DTLib\TestProgram\bin\Debug\net6.0\DtsodV2X\null.dtsod
C:\projects\c#\DTLib\TestProgram\bin\Debug\net6.0\DtsodV30\base_types.dtsod
C:\projects\c#\DTLib\TestProgram\bin\Debug\net6.0\DtsodV30\enumerables.dtsod
C:\projects\c#\DTLib\TestProgram\bin\Debug\net6.0\TestProgram.deps.json
C:\projects\c#\DTLib\TestProgram\bin\Debug\net6.0\TestProgram.runtimeconfig.json
C:\projects\c#\DTLib\TestProgram\bin\Debug\net6.0\TestProgram.dll
C:\projects\c#\DTLib\TestProgram\bin\Debug\net6.0\TestProgram.pdb
C:\projects\c#\DTLib\TestProgram\bin\Debug\net6.0\DTLib.dll
C:\projects\c#\DTLib\TestProgram\bin\Debug\net6.0\DTLib.pdb
C:\projects\c#\DTLib\TestProgram\obj\Debug\net6.0\TestProgram.csproj.CopyComplete
C:\projects\c#\DTLib\TestProgram\obj\Debug\net6.0\TestProgram.dll
C:\projects\c#\DTLib\TestProgram\obj\Debug\net6.0\TestProgram.pdb
C:\projects\c#\DTLib\TestProgram\obj\Debug\net6.0\TestProgram.genruntimeconfig.cache
C:\projects\c#\DTLib\TestProgram\bin\Debug\net6.0\DtsodV2X\complexes.dtsod
C:\projects\c#\DTLib\TestProgram\bin\Debug\net6.0\DtsodV2X\messages.dtsod

Binary file not shown.

Some files were not shown because too many files have changed in this diff Show More