Commit 803b997f66cf2e915897af75a3672e6801a4b501
1 parent
498c336f
Fix GApplication unit test
Showing
3 changed files
with
25 additions
and
28 deletions
src/sky/GSkyRegionCircle.cpp
| ... | ... | @@ -412,7 +412,7 @@ std::string GSkyRegionCircle::write(void) const |
| 412 | 412 | /***********************************************************************//** |
| 413 | 413 | * @brief Print circular region |
| 414 | 414 | * |
| 415 | - * @param[in] chatter Chattiness (defaults to NORMAL). | |
| 415 | + * @param[in] chatter Chattiness | |
| 416 | 416 | * @return String containing region information. |
| 417 | 417 | ***************************************************************************/ |
| 418 | 418 | std::string GSkyRegionCircle::print(const GChatter& chatter) const |
| ... | ... | @@ -423,15 +423,16 @@ std::string GSkyRegionCircle::print(const GChatter& chatter) const |
| 423 | 423 | // Continue only if chatter is not silent |
| 424 | 424 | if (chatter != SILENT) { |
| 425 | 425 | |
| 426 | - // Append string | |
| 426 | + // Append header | |
| 427 | 427 | result.append("=== GSkyRegionCircle ==="); |
| 428 | - result.append("\n("); | |
| 429 | - result.append(gammalib::str(m_centre.ra_deg())); | |
| 430 | - result.append(","); | |
| 431 | - result.append(gammalib::str(m_centre.dec_deg())); | |
| 432 | - result.append(","); | |
| 433 | - result.append(gammalib::str(m_radius)); | |
| 434 | - result.append(")"); | |
| 428 | + | |
| 429 | + // Append sky circle information | |
| 430 | + result.append("\n"+gammalib::parformat("Right Ascension of centre")); | |
| 431 | + result.append(gammalib::str(m_centre.ra_deg())+" deg"); | |
| 432 | + result.append("\n"+gammalib::parformat("Declination of centre")); | |
| 433 | + result.append(gammalib::str(m_centre.dec_deg())+" deg"); | |
| 434 | + result.append("\n"+gammalib::parformat("Radius")); | |
| 435 | + result.append(gammalib::str(m_radius)+" deg"); | |
| 435 | 436 | |
| 436 | 437 | } // endif: chatter was not silent |
| 437 | 438 | ... | ... |
src/sky/GSkyRegions.cpp
| ... | ... | @@ -545,7 +545,7 @@ void GSkyRegions::save(const GFilename& filename) const |
| 545 | 545 | /***********************************************************************//** |
| 546 | 546 | * @brief Print regions |
| 547 | 547 | * |
| 548 | - * @param[in] chatter Chattiness (defaults to NORMAL). | |
| 548 | + * @param[in] chatter Chattiness | |
| 549 | 549 | * @return String containing region container information. |
| 550 | 550 | * |
| 551 | 551 | * Prints all regions into a string. | ... | ... |
test/test_GApplication.cpp
| ... | ... | @@ -462,51 +462,47 @@ void TestGApplication::test_GApplication(void) |
| 462 | 462 | |
| 463 | 463 | // Test logging of header 2 |
| 464 | 464 | fgets(line, 100, fp); |
| 465 | - test_value(line, "\n", "Check log file line 14"); | |
| 465 | + test_value(line, "+----------+\n", "Check log file line 14"); | |
| 466 | 466 | fgets(line, 100, fp); |
| 467 | - test_value(line, "+----------+\n", "Check log file line 15"); | |
| 467 | + test_value(line, "| Header 2 |\n", "Check log file line 15"); | |
| 468 | 468 | fgets(line, 100, fp); |
| 469 | - test_value(line, "| Header 2 |\n", "Check log file line 16"); | |
| 470 | - fgets(line, 100, fp); | |
| 471 | - test_value(line, "+----------+\n", "Check log file line 17"); | |
| 469 | + test_value(line, "+----------+\n", "Check log file line 16"); | |
| 472 | 470 | |
| 473 | 471 | // Test logging of header 3 |
| 474 | 472 | fgets(line, 100, fp); |
| 475 | - test_value(line, "\n", "Check log file line 18"); | |
| 476 | - fgets(line, 100, fp); | |
| 477 | - test_value(line, "=== Header 3 ===\n", "Check log file line 19"); | |
| 473 | + test_value(line, "=== Header 3 ===\n", "Check log file line 17"); | |
| 478 | 474 | |
| 479 | 475 | // Test logging of parameters |
| 480 | 476 | fgets(line, 100, fp); |
| 481 | - test_value(line, "+============+\n", "Check log file line 20"); | |
| 477 | + test_value(line, "+============+\n", "Check log file line 18"); | |
| 482 | 478 | fgets(line, 100, fp); |
| 483 | - test_value(line, "| Parameters |\n", "Check log file line 21"); | |
| 479 | + test_value(line, "| Parameters |\n", "Check log file line 19"); | |
| 484 | 480 | fgets(line, 100, fp); |
| 485 | - test_value(line, "+============+\n", "Check log file line 22"); | |
| 481 | + test_value(line, "+============+\n", "Check log file line 20"); | |
| 486 | 482 | fgets(line, 100, fp); |
| 487 | 483 | test_value(line, " chatter ...................: 2\n", |
| 488 | - "Check log file line 23"); | |
| 484 | + "Check log file line 21"); | |
| 489 | 485 | fgets(line, 100, fp); |
| 490 | 486 | test_value(line, " clobber ...................: yes\n", |
| 491 | - "Check log file line 24"); | |
| 487 | + "Check log file line 22"); | |
| 492 | 488 | fgets(line, 100, fp); |
| 493 | 489 | test_value(line, " debug .....................: no\n", |
| 494 | - "Check log file line 25"); | |
| 490 | + "Check log file line 23"); | |
| 495 | 491 | fgets(line, 100, fp); |
| 496 | 492 | test_value(line, " mode ......................: ql\n", |
| 497 | - "Check log file line 26"); | |
| 493 | + "Check log file line 24"); | |
| 498 | 494 | fgets(line, 100, fp); |
| 499 | 495 | test_value(line, " logfile ...................: test_logfile.log\n", |
| 500 | - "Check log file line 27"); | |
| 496 | + "Check log file line 25"); | |
| 501 | 497 | fgets(line, 32, fp); |
| 502 | 498 | test_value(line, "Application \"test_GApplication\"", |
| 503 | - "Check log file line 28"); | |
| 499 | + "Check log file line 26"); | |
| 504 | 500 | // Empty remaining characters (not checked since they are machine |
| 505 | 501 | // dependent) |
| 506 | 502 | fgets(line, 200, fp); |
| 507 | 503 | fgets(line, 32, fp); |
| 508 | 504 | test_value(line, "Application \"test_GApplication\"", |
| 509 | - "Check log file line 29"); | |
| 505 | + "Check log file line 27"); | |
| 510 | 506 | |
| 511 | 507 | // Close log file |
| 512 | 508 | fclose(fp); | ... | ... |