Mercurial > hg > orthanc
comparison UnitTests/main.cpp @ 532:b22312081388 dicom-rt
extract roi geometry
author | Sebastien Jodogne <s.jodogne@gmail.com> |
---|---|
date | Fri, 30 Aug 2013 16:09:19 +0200 |
parents | 8c3573d28868 |
children | b82292ba2083 |
comparison
equal
deleted
inserted
replaced
529:bd2087bb6450 | 532:b22312081388 |
---|---|
478 std::string u; | 478 std::string u; |
479 ASSERT_THROW(Toolbox::ReadFile(u, path.c_str()), OrthancException); | 479 ASSERT_THROW(Toolbox::ReadFile(u, path.c_str()), OrthancException); |
480 } | 480 } |
481 | 481 |
482 | 482 |
483 TEST(Toolbox, Split) | |
484 { | |
485 std::vector<std::string> s; | |
486 | |
487 Toolbox::Split(s, "", '|'); | |
488 ASSERT_EQ(0, s.size()); | |
489 | |
490 Toolbox::Split(s, "aaaaa", '|'); | |
491 ASSERT_EQ(1, s.size()); | |
492 ASSERT_EQ("aaaaa", s[0]); | |
493 | |
494 Toolbox::Split(s, "aaa|aa", '|'); | |
495 ASSERT_EQ(2, s.size()); | |
496 ASSERT_EQ("aaa", s[0]); | |
497 ASSERT_EQ("aa", s[1]); | |
498 | |
499 Toolbox::Split(s, "a|aa|ab", '|'); | |
500 ASSERT_EQ(3, s.size()); | |
501 ASSERT_EQ("a", s[0]); | |
502 ASSERT_EQ("aa", s[1]); | |
503 ASSERT_EQ("ab", s[2]); | |
504 | |
505 Toolbox::Split(s, "||ab", '|'); | |
506 ASSERT_EQ(3, s.size()); | |
507 ASSERT_EQ("", s[0]); | |
508 ASSERT_EQ("", s[1]); | |
509 ASSERT_EQ("ab", s[2]); | |
510 | |
511 Toolbox::Split(s, "|", '|'); | |
512 ASSERT_EQ(2, s.size()); | |
513 ASSERT_EQ("", s[0]); | |
514 ASSERT_EQ("", s[1]); | |
515 | |
516 Toolbox::Split(s, "||", '|'); | |
517 ASSERT_EQ(3, s.size()); | |
518 ASSERT_EQ("", s[0]); | |
519 ASSERT_EQ("", s[1]); | |
520 ASSERT_EQ("", s[2]); | |
521 } | |
522 | |
523 | |
483 int main(int argc, char **argv) | 524 int main(int argc, char **argv) |
484 { | 525 { |
485 // Initialize Google's logging library. | 526 // Initialize Google's logging library. |
486 FLAGS_logtostderr = true; | 527 FLAGS_logtostderr = true; |
487 FLAGS_minloglevel = 0; | 528 FLAGS_minloglevel = 0; |