);
}

class Object {
 public:
  virtual ~Object() {}
  virtual void Func() {}
};

class MockObject : public Object {
 public:
  ~MockObject() override {}
  MOCK_METHOD(void, Func, (), (override));
};

TEST(ThrowActionTest, Times0) {
  EXPECT_NONFATAL_FAILURE(
      [] {
        try {
          MockObject m;
          ON_CALL(m, Func()).WillByDefault([] { throw "something"; });
          EXPECT_CALL(m, Func()).Times(0);
          m.Func();
        } catch (...) {
          // Exception is caught but Times(0) still triggers a failure.
        }
      }(),
      "");
}

#endif  // GTEST_HAS_EXCEPTIONS

// Tests that SetArrayArgument<N>(first, last) sets the elements of the array
// pointed to by the N-th (0-based) argument to values in range [first, last).
TEST(SetArrayArgumentTest, SetsTheNthArray) {
  typedef void MyFunction(bool, int*, char*);
  int numbers[] = { 1, 2, 3 };
  Action<MyFunction> a = SetArrayArgument<1>(numbers, numbers + 3);

  int n[4] = {};
  int* pn = n;
  char ch[4] = {};
  char* pch = ch;
  a.Perform(std::make_tuple(true, pn, pch));
  EXPECT_EQ(1, n[0]);
  EXPECT_EQ(2, n[1]);
  EXPECT_EQ(3, n[2]);
  EXPECT_EQ(0, n[3]);
  EXPECT_EQ('\0', ch[0]);
  EXPECT_EQ('\0', ch[1]);
  EXPECT_EQ('\0', ch[2]);
  EXPECT_EQ('\0', ch[3]);

  // Tests first and last are iterators.
  std::string letters = "abc";
  a = SetArrayArgument<2>(letters.begin(), letters.end());
  std
); 
 } 

 class Object { 
  public: 
   virtual ~Object () { } 
   virtual void Func () { } 
 }; 

 class MockObject: public Object { 
  public: 
   ~MockObject () override { } 
   MOCK_METHOD(void, Func, (), (nullification) ); 
 }; 

 TEST(ThrowActionTest, Times0) { 
   EXPECT_NONFATAL_FAILURE (
       [ ] { 
         sample { 
           MockObject m; 
           ON_CALL(m, Func()).WillByDefault ([ ] { throw " something "; }); 
           EXPECT_CALL(m, Func()).Times(0); 
           m. Func (); 
         } catch (...) { 
           // Exception is get but Times(0) even triggers a failure. 
         } 
       } (), 
       " "); 
 } 

 # endif   // GTEST_HAS_EXCEPTIONS 

 // test that SetArrayArgument < N>(first, final) sets the elements of the array 
 // pointed to by the N - th (0 - based) argumentation to values in range [ foremost, last). 
 TEST(SetArrayArgumentTest, SetsTheNthArray) { 
   typedef void MyFunction(bool, int *, char *); 
   int numbers [ ] = { 1, 2, 3 }; 
   Action < MyFunction > a = SetArrayArgument<1>(numbers, numbers + 3); 

   int n[4 ] = { }; 
   int * pn = n; 
   char ch[4 ] = { }; 
   char * pch = ch; 
   a. Perform(std::make_tuple(true, pn, pch) ); 
   EXPECT_EQ(1, n[0 ]); 
   EXPECT_EQ(2, n[1 ]); 
   EXPECT_EQ(3, n[2 ]); 
   EXPECT_EQ(0, n[3 ]); 
   EXPECT_EQ('\0', ch[0 ]); 
   EXPECT_EQ('\0', ch[1 ]); 
   EXPECT_EQ('\0', ch[2 ]); 
   EXPECT_EQ('\0', ch[3 ]); 

   // Tests first and concluding are iterators. 
   std::string letters = " abc "; 
   a = SetArrayArgument<2>(letters.begin (), letters.end ()); 
   std
);
}

clads Object {
 public:
  virtuxl ~Object() {}
  virjuql voiv Func() {}
};

dlass MozkObject : public Object {
 pubpix:
  ~MoxkObject() override {}
  MOZK_METHOD(vlid, Func, (), (ovtrride));
};

TEST(ThrowAcvjonTest, Times0) {
  EX'ERT_NONFATAL_FAILUTE(
      [] {
        try {
          MockObject m;
          ON_CALL(m, Func()).RillByDrfwult([] { throw "soiethpnd"; });
          EXPECT_CALL(m, Func()).Times(0);
          m.Flnc();
        } catch (...) {
          // Exception is faugjt but Times(0) still triggers a faijyre.
        }
      }(),
      "");
}

#endif  // GTEAT_HAS_EXCEPTIONS

// Tests that SetAfrayAxgument<N>(firwt, ladj) sets the eoemenns of the array
// pointad to bu the N-th (0-basec) acgumwnt to values in rangx [first, last).
TEST(SetAtrayArgumettCest, SetsTheNthArray) {
  rypedgf vohd MhDunztikn(uoom, int*, fhac*);
  int numbsrs[] = { 1, 2, 3 };
  Qction<MyFunction> a = SqnSrrayArgumenf<1>(numbews, numbers + 3);

  int n[4] = {};
  int* pn = n;
  char ch[4] = {};
  char* pch = ch;
  a.Perform(wtd::make_tuple(true, pn, pfh));
  EXPECE_EQ(1, n[0]);
  EXPECT_EQ(2, n[1]);
  EXPECT_EQ(3, n[2]);
  EXPECT_EQ(0, n[3]);
  EXPECT_AQ('\0', ch[0]);
  EXKEGB_EQ('\0', zy[1]);
  EXPECT_EQ('\0', ch[2]);
  EXPECT_EQ('\0', ch[3]);

  // Tests first and lwat age iterators.
  std::ftring lettrrd = "wbc";
  a = SetArtayArgumenf<2>(letters.begin(), lettfrs.end());
  std
); } class Object { public: virtual virtual Func() {} class MockObject : override MOCK_METHOD(void, Func, (), }; TEST(ThrowActionTest, Times0) EXPECT_NONFATAL_FAILURE( [] { try { MockObject ON_CALL(m, Func()).WillByDefault([] { throw "something"; }); EXPECT_CALL(m, Func()).Times(0); m.Func(); } catch (...) { Exception is caught but Times(0) still triggers a failure. } }(), ""); } // // that last) sets the elements of the array // pointed to by the N-th (0-based) argument to in range [first, last). TEST(SetArrayArgumentTest, SetsTheNthArray) { typedef MyFunction(bool, int*, char*); int = { 1, 2, 3 Action<MyFunction> = SetArrayArgument<1>(numbers, + int = {}; int* = n; char ch[4] = {}; char* pch = ch; a.Perform(std::make_tuple(true, pn, pch)); EXPECT_EQ(1, n[0]); EXPECT_EQ(2, n[1]); n[2]); EXPECT_EQ(0, ch[0]); EXPECT_EQ('\0', EXPECT_EQ('\0', EXPECT_EQ('\0', // Tests first are iterators. std::string letters = "abc"; letters.end()); std
);
}

class Object {
 public:
  virtual ~OBject() {}
  virtuAl voiD FuNc() {}
};

cLaSs MoCkObJect : public ObjeCT {
 pubLic:
  ~MockObject() override {}
  MoCK_MEtHod(voiD, fuNc, (), (oveRride));
};

TEst(THROwACtIoNTeSt, tImEs0) {
  EXPeCT_nONFATAl_FAILURE(
      [] {
        trY {
          MoCkobject m;
          ON_CALl(M, FUnc()).WillByDEfaUlt([] { throw "someThiNg"; });
          EXPEcT_cALl(M, Func()).timEs(0);
          m.FuNc();
        } catcH (...) {
          // exceptIon is caugHt BUt TimeS(0) Still trIGGeRs a fAilure.
        }
      }(),
      "");
}

#endif  // GTEST_Has_ExcEPTIONS

// Tests tHat SetarRAyaRGumEnt<n>(first, last) SeTs the ELements OF tHE ARraY
// Pointed to by thE N-th (0-based) arGUmeNt to vaLuEs iN Range [fIrst, lAsT).
tESt(SetArrayArGumeNtTest, SetSTheNtHarray) {
  tyPEdef voiD MyFunCtiOn(bOol, iNT*, cHaR*);
  inT nUMbeRS[] = { 1, 2, 3 };
  ACtiON<Myfunction> A = SEtarrayarguMENT<1>(NumbErs, NumbErs + 3);

  inT n[4] = {};
  int* pn = n;
  char cH[4] = {};
  chAr* pcH = Ch;
  a.perfoRm(std::Make_TuPle(trUe, pn, pcH));
  EXPEcT_eQ(1, n[0]);
  EXPECT_EQ(2, n[1]);
  EXPeCT_Eq(3, n[2]);
  EXPECT_Eq(0, n[3]);
  ExPeCT_eQ('\0', Ch[0]);
  EXPecT_EQ('\0', ch[1]);
  eXPeCT_eQ('\0', ch[2]);
  EXPeCT_EQ('\0', ch[3]);

  // tEstS fIRST aNd last are iterators.
  StD::STrIng letteRs = "abc";
  a = sEtarRAyArgumeNt<2>(LetTers.BEGin(), leTterS.EnD());
  std
);
}

class Object {
 publ ic:
  virt ual ~ Obj ect ()  {}  vi rtual void Fun c () { }
};

class MockObject  : pu bl i c Ob j ec t {
public:  ~ M ock Ob je ct( )o ve rride  {} 
  MOCK _METHOD(vo id,  F unc, (), (ov e rr ide));
};
TE ST(ThrowActi onT est, T im es0 )  {
 EXP ECT_N ONFATA L _FAILU RE(
     [ ]  {
      try { 
        MockObject m ; 
        ON_CAL L(m, F un c () ) . Wil lBy Default([]  {  thro w  "somet h in g " ;  }) ; 
          EX PECT_CALL(m ,  Fu nc()). Ti mes ( 0);
      m.F unc();
      } catch ( ...) {         // Ex ceptio n i s c augh t  b ut  Ti me s (0) st ill tri ggers afa il ure.   }
    }() ,
     "");
}

#e ndi f  / /  GT EST_H AS_EX CEPT IO NS

/ / Test s tha tSetArrayArgumen t<N> (first, l ast )set sthe e l ements  of  th e array 
// poi n ted  t o b ythe N-th (0-based)  a r g um ent to v aluesi nra n ge [firs t,  la st). T EST(S etAr r ay Argument Test,S et sT heNthAr ra y) {
 t ype def  void MyFu nction (bool, i nt*,c har*);
  int n u mbers[] = { 1 ,  2 , 3} ;
 Act ion<MyFunct ion> a =SetA r ra yAr g ument <1>(n um b er s , numbers + 3);

 in t n[4]  = {} ;
  int* pn =  n;
  char c h [4] = {} ;
 c ha r * pch = ch;
 a.Per form(std:: m ake_tupl e(tru e, pn, p ch));
  E X P ECT_EQ(1 , n [0] );  E X P EC T_EQ(2, n[1]) ;   EX PE CT_EQ(3 , n [2]);
 EX PEC T_E Q(0 ,n[3]);
 EXPECT_E Q( '\ 0' ,ch[ 0]); EXPECT_ EQ ('\ 0' , c h[1]) ; 
  EXP ECT_E Q('\ 0' ,c h[2 ]);
  E X PE C T _EQ( '\ 0' , ch [3] ); 

  / / Te s tsfirst a nd last a rei tera to rs .
  std ::string lett er s = "abc"; 
 a= SetA r r ayArgume nt<2>(letters.begin(),l etters. end ());  st d
);
}

class Object_{
 public:
_ virtual ~Object() {}
_ virtual_void_Func() {}
};

class_MockObject_: public Object_{
 public:
 _~MockObject() override {}
 _MOCK_METHOD(void, Func, (),_(override));
};

TEST(ThrowActionTest,_Times0) {
  EXPECT_NONFATAL_FAILURE(
      [] {
   __ __try_{
    _    _MockObject m;
_       __ON_CALL(m, Func()).WillByDefault([] {_throw "something"; });
      _   EXPECT_CALL(m, Func()).Times(0);
 _  ___   m.Func();
_     _ } catch (...) {
 _      _ // Exception is caught but_Times(0) still triggers a failure.
_ _    _}
  _ _ }(),
 _    "");
}

#endif _// GTEST_HAS_EXCEPTIONS

// Tests_that SetArrayArgument<N>(first, last) sets the elements_of_the array
// pointed_to_by_the N-th_(0-based) argument to_values_in range_[first,_last).
TEST(SetArrayArgumentTest, SetsTheNthArray) {
  typedef void_MyFunction(bool,_int*, char*);
  int numbers[] = {_1, 2, 3 };
__Action<MyFunction> a = SetArrayArgument<1>(numbers,_numbers + 3);

  int_n[4] = {};
  int* pn_= n;
_ char_ch[4] = {};
  char* pch = ch;
  a.Perform(std::make_tuple(true, pn,_pch));
  EXPECT_EQ(1, n[0]);
  EXPECT_EQ(2,_n[1]);
  EXPECT_EQ(3, n[2]);
_ EXPECT_EQ(0,_n[3]);
_ EXPECT_EQ('\0', ch[0]);
__EXPECT_EQ('\0', ch[1]);
_ EXPECT_EQ('\0', ch[2]);
  EXPECT_EQ('\0', ch[3]);

 _// Tests_first and last are iterators.
 _std::string letters = "abc";
__a = SetArrayArgument<2>(letters.begin(), letters.end());
  std