Skip to content
Snippets Groups Projects
Commit 76145306 authored by Jean-Marc's avatar Jean-Marc
Browse files

test modifs2

parent 5da13a9d
No related branches found
No related tags found
No related merge requests found
Pipeline #190235 failed
#ifndef _IMAGE_H
#define _IMAGE_H
#include "Pixel.h"
#include <cassert>
#include <iostream>
using namespace std;
......@@ -19,38 +18,7 @@ private:
~Image();
void static testRegression()
{
Image im1;
Image im2(50,50);
Pixel p;
assert(im1.dimx == 0);
assert(im1.dimy == 0);
p = im2.getPix(10,15);
assert(p.r == 0);
assert(p.g == 0);
assert(p.b == 0);
p = im2.getPix2(18,36);
assert(p.r == 0);
assert(p.g == 0);
assert(p.b == 0);
Pixel p2(140,169,78);
//cout<<int(p2.r)<<" "<<int(p2.g)<<endl;
im1.dimx = 50;
im1.dimy = 50;
im1.setPix(25,14,p2);
Pixel p3 = im1.getPix2(25,14);
//cout<<int(p3.r)<<" "<<int(p3.g)<<endl;
assert(p3.r == 140);
assert(p3.g == 169);
assert(p3.b == 78);
im2.dessinerRectangle(10,10,20,20,p2);
im2.effacer(p3);
//cout<<im2.getPix(25,14).r<<" "<<im2.getPix(25,14).g<<endl;
assert(im2.getPix(25,14).r == 140);
assert(im2.getPix(25,14).g == 169);
assert(im2.getPix(25,14).b == 78);
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment