push
travis-ci
6380 of 8858 relevant lines covered (72.03%)
8431877.5 hits per line
1 |
#include "Point.h" |
|
2 |
|
|
3 |
|
|
4 |
/**
|
|
5 |
* @brief Constructor initializes an empty Point. |
|
6 |
*/ |
|
7 |
Point::Point() { |
47,815,227✔ |
8 |
_xyz = new double[3]; |
47,815,227✔ |
9 |
_xyz[0] = 0.0; |
47,815,633✔ |
10 |
_xyz[1] = 0.0; |
47,815,633✔ |
11 |
_xyz[2] = 0.0; |
47,815,633✔ |
12 |
} |
47,815,633✔ |
13 |
|
|
14 |
|
|
15 |
/**
|
|
16 |
* @brief Destructor |
|
17 |
*/ |
|
18 |
Point::~Point() { |
45,473,357✔ |
19 |
delete [] _xyz;
|
45,470,725✔ |
20 |
} |
45,474,149✔ |
21 |
|
|
22 |
|
|
23 |
/**
|
|
24 |
* @brief Converts this Point to a character representation of its attributes. |
|
25 |
* @details The character array includes the x-coordinate, y-coordinate, and |
|
26 |
* z-coordinate |
|
27 |
* @return a character array of this Point's attributes |
|
28 |
*/ |
|
29 |
std::string Point::toString() {
|
× |
30 |
std::stringstream string;
|
× |
31 |
string << "Point: x = " << _xyz[0] << ", y = " << _xyz[1] << ", z = " |
× |
32 |
<< _xyz[2];
|
× |
33 |
return string.str(); |
× |
34 |
} |
540✔ |