COMP2113
COMP2113_ENGG1340 Programming technologies and Computer programming II [Section 2BC] [2023]
Loading...
Searching...
No Matches
2_testcase.cpp File Reference
#include <iostream>
#include <cassert>
#include "bounding.h"
Include dependency graph for 2_testcase.cpp:

Go to the source code of this file.

Functions

void check_and_reset (int &x1, int &y1, int &w1, int &h1, int x2, int y2, int w2, int h2)
 
int main ()
 

Function Documentation

◆ check_and_reset()

void check_and_reset ( int & x1,
int & y1,
int & w1,
int & h1,
int x2,
int y2,
int w2,
int h2 )

Definition at line 6 of file 2_testcase.cpp.

6 {
7 assert(x1 == x2 && y1 == y2 && w1 == w2 && h1 == h2);
8 x1 = 0;
9 y1 = 0;
10 w1 = 10;
11 h1 = 10;
12}

Referenced by main().

Here is the caller graph for this function:

◆ main()

int main ( void )

Definition at line 14 of file 2_testcase.cpp.

14 {
15 int x1 = 0;
16 int y1 = 0;
17 int w1 = 10;
18 int h1 = 10;
19 cout << "question2-----ext1" << endl;
20 assert(mergeBoundingBoxes(x1,y1,w1,h1,5,5,10,10) == true);
21 check_and_reset(x1,y1,w1,h1,0,0,15,15);
22 cout << "question2-----ext2" << endl;
23 assert(mergeBoundingBoxes(x1,y1,w1,h1,5,-5,10,10) == true);
24 check_and_reset(x1,y1,w1,h1,0,-5,15,15);
25 cout << "question2-----ext3" << endl;
26 assert(mergeBoundingBoxes(x1,y1,w1,h1,-5,-5,10,10) == true);
27 check_and_reset(x1,y1,w1,h1,-5,-5,15,15);
28 cout << "question2-----ext4" << endl;
29 assert(mergeBoundingBoxes(x1,y1,w1,h1,-5,5,10,10) == true);
30 check_and_reset(x1,y1,w1,h1,-5,0,15,15);
31 return 0;
32}
void check_and_reset(int &x1, int &y1, int &w1, int &h1, int x2, int y2, int w2, int h2)
Definition 2_testcase.cpp:6
bool mergeBoundingBoxes(int &x1, int &y1, int &w1, int &h1, int x2, int y2, int w2, int h2)
Definition 2.cpp:9

References check_and_reset(), and mergeBoundingBoxes().

Here is the call graph for this function: