TOP Contributors

  1. MIKROE (2656 codes)
  2. Alcides Ramos (353 codes)
  3. Shawon Shahryiar (307 codes)
  4. jm_palomino (112 codes)
  5. Chisanga Mumba (90 codes)
  6. S P (73 codes)
  7. dany (71 codes)
  8. MikroBUS.NET Team (35 codes)
  9. NART SCHINACKOW (34 codes)
  10. Armstrong Subero (27 codes)

Most Downloaded

  1. Timer Calculator (136824 times)
  2. FAT32 Library (69986 times)
  3. Network Ethernet Library (55975 times)
  4. USB Device Library (46287 times)
  5. Network WiFi Library (41894 times)
  6. FT800 Library (41203 times)
  7. GSM click (29009 times)
  8. PID Library (26421 times)
  9. mikroSDK (26389 times)
  10. microSD click (25383 times)
Libstock prefers package manager

Package Manager

We strongly encourage users to use Package manager for sharing their code on Libstock website, because it boosts your efficiency and leaves the end user with no room for error. [more info]

< Back
Library

Expectations

Rating:

0

Author: VCC

Last Updated: 2024-04-22

Package Version: 1.0.0.0

Category: Other Codes

Downloaded: 6 times

Not followed.

License: MIT license  

This is a small library with testing functions, inspired by Jasmine testing framework. It supports several datatypes for writing tests, like String, Integer, DWord, Boolean and raw data. There is also a counterpart library for desktop applications. The provided examples test the DynArrays library.

No Abuse Reported

Do you want to subscribe in order to receive notifications regarding "Expectations" changes.

Do you want to unsubscribe in order to stop receiving notifications regarding "Expectations" changes.

Do you want to report abuse regarding "Expectations".

  • Information
  • Comments (0)
DOWNLOAD LINK RELATED COMPILER CONTAINS
mikroPascal PRO for PIC32
  • lib
  • src
  • exa
  • hlp
  • hex
  • sch
  • pcb
  • doc

Library Blog

Expectations is a library, which provides several functions, which can be used in writing tests. So far, the supported datatypes are: String, Integer, DWord, Boolean and raw data.

Tested library by included projects: DynArrays

Example:

procedure TTestDynArrays_TestWritingToArray;
var
  Arr: TDynArrayOfByte;
begin
  InitDynArrayToEmpty(Arr);
  SetDynLength(Arr, 20);

  Arr.Content^[17] := 80;
  ExpectDWord(Arr.Content^[17]).ToBe(80, '');

  FreeDynArray(Arr);
end;


procedure TTestDynArrays_TestReallocationToLargerArray;
var
  Arr: TDynArrayOfByte;
  i: Integer;
begin
  InitDynArrayToEmpty(Arr);
  ExpectBoolean(SetDynLength(Arr, 20)).ToBe(True, '');

  for i := 0 to DynLength(Arr) - 1 do
    Arr.Content^[i] := i * 10;

  ExpectBoolean(SetDynLength(Arr, 30)).ToBe(True, 'expecting successful reallocation');

  for i := 0 to 20 - 1 do  //test up to the old length, as this content has to be valid only
    ExpectDWord(Arr.Content^[i]).ToBe(DWord(i * 10), '');

  FreeDynArray(Arr);
end;


The test results are reported through UART. (See included example projects)

ALSO FROM THIS AUTHOR

Misaligned Address Finder

1

Misaligned Address Finder is a tool used to generate a report on variables and constants, which are not Word or DWord aligned. Some variables / constants are required to be allocated at even addresses (16-bit architectures) and at multiple by 4 addresses (32-bit architectures), so users can be notified about that allocation.

[Learn More]

USB FPGA programmer

5

The project is a Xilinx Spartan-3(E) and Spartan-6 FPGA programmer made with PIC18F4550 using USB. There are two host applications: a HID one and a CDC one, written in Delphi. Added support for Delphi XE5.

[Learn More]

Resolver connected to AD2S1200 decoder with CmodA7 board

0

ResolverAD2S1200DecA7 is a hardware + software project, which uses AD2S1200 chip, to interface with a resolver, for motor control applications. To talk to the AD2S1200 chip, the Digilent's CmodA7 board is used.

[Learn More]