Exemplo n.º 1
0
/* ****************************************************************************
*
* check - should Scope::check always return "OK"?
*/
TEST(Scope, check)
{
  Scope        scope;
  Scope        scope1("",     "value");
  Scope        scope2("type", "");
  Scope        scope3("type", "value");
  std::string  checked;
  std::string  expected  = "Empty type in restriction scope";
  std::string  expected1 = "Empty type in restriction scope";
  std::string  expected2 = "Empty value in restriction scope";
  std::string  expected3 = "OK";
  
  utInit();

  checked = scope.check(RegisterContext, XML, "", "", 0);
  EXPECT_STREQ(checked.c_str(), expected.c_str());

  checked = scope1.check(RegisterContext, XML, "", "", 0);
  EXPECT_STREQ(checked.c_str(), expected1.c_str());

  checked = scope2.check(RegisterContext, XML, "", "", 0);
  EXPECT_STREQ(checked.c_str(), expected2.c_str());

  checked = scope3.check(RegisterContext, XML, "", "", 0);
  EXPECT_STREQ(checked.c_str(), expected3.c_str());

  utExit();
}
Exemplo n.º 2
0
int main() {
  scope1();
  scope2();
  scope3();
  scope4();
  scope5();
  return 0;
}