Asseracje – kontynuacja projektu

Jest to drobnę rozwinięcie biblioteki stąd http://darkgl.pl/index.php/2013/09/12/asseracje-w-pawn/ ( radzę się zapoznać najpierw z poprzednim postem ) ;). Do biblioteki zostały dwa nowe makra
  • shouldBeTrue
  • shouldBeFalse
shouldBeTrue – wyrażenie powinno mieć wartość True shouldBeFalse – wyrażenie powinno mieć wartość False przykład użycia
Plain text
Copy to clipboard
Open code in new window
EnlighterJS 3 Syntax Highlighter
#include <amxmodx>
#include <amxmisc></amxmisc></amxmodx>
#include "assert.inc"
#define PLUGIN "New Plugin"
#define AUTHOR "DarkGL"
#define VERSION "1.0"
public plugin_init(){
register_plugin(PLUGIN, VERSION, AUTHOR);
new varOne = false,
varTwo = true,
varThird = false;
shouldBeFalse( varOne );
shouldBeTrue( varTwo );
shouldBeTrue( varThird );
}
#include <amxmodx> #include <amxmisc></amxmisc></amxmodx> #include "assert.inc" #define PLUGIN "New Plugin" #define AUTHOR "DarkGL" #define VERSION "1.0" public plugin_init(){ register_plugin(PLUGIN, VERSION, AUTHOR); new varOne = false, varTwo = true, varThird = false; shouldBeFalse( varOne ); shouldBeTrue( varTwo ); shouldBeTrue( varThird ); }
#include 
#include 

#include "assert.inc"

#define PLUGIN	"New Plugin"
#define AUTHOR	"DarkGL"
#define VERSION	"1.0"

public plugin_init(){

register_plugin(PLUGIN, VERSION, AUTHOR);

new varOne = false,
varTwo = true,
varThird = false;

shouldBeFalse( varOne );
shouldBeTrue( varTwo );

shouldBeTrue( varThird );
}
Tak jak poprzednio asseracje wyłączamy deklarując makrodefinicję NDEBUG
Plain text
Copy to clipboard
Open code in new window
EnlighterJS 3 Syntax Highlighter
#define NDEBUG
#define NDEBUG
#define NDEBUG
assert.zip Download

Dodaj komentarz

This site uses Akismet to reduce spam. Learn how your comment data is processed.