Skip to content

Instantly share code, notes, and snippets.

@ComingNine
ComingNine / TestFloatInVariant.dpr
Created September 3, 2018 14:39
Float in a variant field of TSQLRecord becomes string when got back from DB
program TestFloatInVariant;
{$APPTYPE CONSOLE}
uses
FastMM4,
SysUtils,
Variants,
SynCommons,
SynLog,
@ComingNine
ComingNine / NestedRecordArray_ExternalSIGSEGV.dpr
Created August 5, 2018 17:05
If built with FPC for i386-win32, the application gives "External SIGSEGV". Line 120..130 seems to be the cause...
program NestedRecordArray_ExternalSIGSEGV;
{$I Synopse.inc} // define HASINLINE USETYPEINFO CPU32 CPU64 OWNNORMTOUPPER
{$IFOPT D+} {$DEFINE DEBUG} {$ENDIF}
{$ASSERTIONS ON}
{$IFNDEF FPC} {$APPTYPE CONSOLE} {$ENDIF}
uses
{$I SynDprUses.inc} // use FastMM4 on older Delphi, or set FPC threads
SysUtils, RTLConsts, Classes, Contnrs,
@ComingNine
ComingNine / TestRecordWithEnumProp.dpr
Last active July 30, 2018 14:52
Cannot serialize record with enum property.
Program TestRecordWithEnumProp;
{$I Synopse.inc} // define HASINLINE USETYPEINFO CPU32 CPU64 OWNNORMTOUPPER
{$IFOPT D+} {$DEFINE DEBUG} {$ENDIF}
{$ASSERTIONS ON}
{$IFNDEF FPC} {$APPTYPE CONSOLE} {$ENDIF}
uses
{$I SynDprUses.inc} // use FastMM4 on older Delphi, or set FPC threads
SysUtils, SynCommons, mORMot;
@ComingNine
ComingNine / DeserializeClassWithPropertyBackedByMethods1.dpr
Last active July 17, 2018 02:36
Deserialize Class With Property Backed By Methods - two examples
program DeserializeClassWithPropertyBackedByMethods1;
{$APPTYPE CONSOLE}
uses
FastMM4,
SysUtils,
Types,
SynCommons,
mORMot;
@ComingNine
ComingNine / SynTests.pas
Created December 22, 2017 05:40
SynTests.pas capable of generating dunit-report.xml
/// Unit test functions used by Synopse projects
// - this unit is a part of the freeware Synopse mORMot framework,
// licensed under a MPL/GPL/LGPL tri-license; version 1.18
unit SynTests;
(*
This file is part of Synopse framework.
Synopse framework. Copyright (C) 2017 Arnaud Bouchez
Synopse Informatique - https://synopse.info