Questions tagged [dunit]

xUnit-style unit testing for Borland Delphi programs.

DUnit is an Xtreme testing framework for Borland Delphi programs. It was originally inspired on the JUnit framework written in Java by Kent Beck and Erich Gamma, but has evolved into a tool that uses much more of the potential of Delphi to be much more useful to Delphi developers.

Source code and mailing lists are available at DUnit's Source Forge page.

89 questions
2
votes
1 answer

How to handle "false" / expected memory in DUnit using LeakCheck?

In order to prune out all of memory leaks I am trying to incorporate LeakCheck library into DUnit. The problem is that LeakCheck will report me memory leaks that are not true leaks. These are objects or other stuff allocated by RTL and destroyed on…
Wodzu
  • 6,932
  • 10
  • 65
  • 105
2
votes
1 answer

CEF4Delphi and DUnit

I am testing a few processes I have created with CEF4Delphi in my application via DUnit. The following is a MCVE to reproduce the issue: unit MyUnit; interface {$I cef.inc} uses Winapi.Windows, Winapi.Messages, System.SysUtils, …
pio pio
  • 732
  • 1
  • 7
  • 29
2
votes
1 answer

Delphi Unit Testing : Writing a simple spy for the CUT

I'm searching for a way to easily and concisely write a spy for the DUnitX testing framework under Delphi. In the past, I've used very ugly ways of doing that using : [TestFixture] Test = class(TObject) public [test] procedure…
Ludovic C
  • 2,855
  • 20
  • 40
2
votes
1 answer

How to Mock Spring4D Events with DUnit

I am struggling to successfully mock a Spring4d Event with DUnit. In fact I am more mocking a mock returning a mock of an event... This is the basic structure. TMyObject --EventContainer--> TMock --Event--> TMock TMyObject…
Ludovic C
  • 2,855
  • 20
  • 40
2
votes
2 answers

DUnit Testing in a Midas/DataSnap project

How does one setup DUnit Testing in a Midas/DataSnap project in Delphi 2006 Edit How does one set up a Dunit Test into a TRemoteDataModule The project wizard in Delphi 2006 does not work with TRemoteDataModule
Charles Faiga
  • 11,665
  • 25
  • 102
  • 139
2
votes
3 answers

Delphi -> disable deprecated warnings from external Units

I have a XE2 test project (DUnit). All works and compiles fine. However we have one warning that I have not been able to eliminate: [DCC Warning] GUITestRunner.pas(1237): W1000 Symbol 'TimeSeparator' is deprecated: 'Use…
santiagoIT
  • 9,411
  • 6
  • 46
  • 57
2
votes
2 answers

The reason for the difference between TXPSubject.DeleteObserver and TXPSubject.DeleteObservers in DUnit's XPObserver.pas?

I find it hard to understand the reason why implementations of TXPSubject.DeleteObserver and TXPSubject.DeleteObservers in XPObserver.pas are different? Specifically, the different order of "Dispose" and "ReleaseSubject" calls, and the reasoning why…
SOUser
  • 3,802
  • 5
  • 33
  • 63
2
votes
2 answers

What's the easiest way to access other .exe data in delphi?

I trying to implement some basic automated testing on a 10 million LOC project that don't follow good OO pratices (ex: isolating business logic into classes/units) with the DUnit that comes along with Delphi 2010. I can't do normal unit testing on…
Daniel Santos
  • 1,451
  • 15
  • 38
2
votes
3 answers

how to compile DUnit2

I've just downloaded from SVN the DUnit2 code base. Does someone has compiled it successfully? What steps/prerequisites I've to follow in order to compile it? Do someone knows if an already compiled version exists? thank you fabio vitale
Fabio Vitale
  • 2,257
  • 5
  • 28
  • 38
1
vote
2 answers

DunitX, how to run only one test?

Everytime I run my DUnitX project, it's ran all tests. Is their a simple way to make it run only one test (The test I m working on for example)? Is it possible specify the test to run in the command line?
zeus
  • 12,173
  • 9
  • 63
  • 184
1
vote
1 answer

DUNIT X , pass large number of strings

I need to pass a lot of string values to a test procedure, the string parameters are transferred as a commatext stringlist, code goes like below [test] [testcase(test1,'xxxx,yyyy,zzz, ........')] procedure Test_transmitmany strings(S1, S2, S3, …
Franz
  • 1,883
  • 26
  • 47
1
vote
2 answers

Delphi 2007 Version Info missing from Exe

I have a Delphi 2007 project and I'm trying to set the Project->Options->'Version Info'. I enter the values into the form and save the project. However, when I build, the generated exe doesn't contain the Version Info that I entered. In fact, it…
mchlstckl
  • 3,390
  • 2
  • 21
  • 21
1
vote
1 answer

Delphi Mocks lifecycle in DUnit

I want to test the simplest case : testing a mocked strategy object. (look at : Strategy pattern). If I create a TMock in the TTestCase.setUp methods and store it in a TTestCase instance attribute, then should I free/NIL the mock variable in the…
The Bitman
  • 1,279
  • 1
  • 11
  • 25
1
vote
1 answer

How to determine which hierarchy will be tested and untested in DUnit in app console?

How to determine which hierarchy will be tested and untested in DUnit in app console? When i work in GUI mode, i can check and unchek the hierarcy.
bagus prasojo
  • 595
  • 5
  • 18
1
vote
1 answer

link obj files in embarcadero c++ builder Dunit Test Project

I'have added a test case to DUnit Test project in embarcadero c++ builder 2010. I can compile it fine but the linker fails saying "unresolved external" to a method in an .obj file from original project. If I add the .obj file to DUnit project it…
nadunDev
  • 25
  • 5