fs/_tests/fsMath/main.cpp

Go to the documentation of this file.
00001 
00002 //---------------------------------------------------------------------------
00003 #include <fs/fs_mth.h>
00004 
00005 #include <cassert>
00006 //---------------------------------------------------------------------------
00007 int main()
00008 {
00009     using namespace fs::mth;
00010     
00011     //---
00012     
00013     Vec2i_t v1(1, 2);
00014     Vec2i_t v2(3, 4);
00015     assert(v1 == v1);
00016     assert(v1 != v2);
00017             
00018     Vec2i_t v3(v1);
00019     v3 += v2;
00020     v3 -= v2;
00021     assert(v1 == v3);
00022     
00023     Vec2i_t v4(v1);
00024     v4 *= 2;
00025     assert(v4 == v1 + v1);
00026     assert(2 * v1 == v1 + v1);
00027     assert(v1 * 2 == v1 + v1);
00028     
00029     //---
00030             
00031     Rec2i_t r1(v1, v2);
00032     Rec2i_t r2(5, 6, 7, 8);
00033     assert(r1 == r1);
00034     assert(r1 != r2);
00035     assert(r1.Delta() == v2 - v1);
00036         
00037     return 0;
00038 }
00039 //---------------------------------------------------------------------------

FipS' Code (Thu Feb 15 22:43:35 2007) - (c) Filip STOKLAS (FipS) - [ www ] [ Guest Book ]