这篇教程C++ AssertTrue函数代码示例写得很实用,希望能帮到您。
本文整理汇总了C++中AssertTrue函数的典型用法代码示例。如果您正苦于以下问题:C++ AssertTrue函数的具体用法?C++ AssertTrue怎么用?C++ AssertTrue使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。 在下文中一共展示了AssertTrue函数的21个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。 示例1: audio_enumerateAndNameAudioDevicesNegativeTests/** * /brief Negative tests around enumeration and naming of audio devices. * * /sa http://wiki.libsdl.org/moin.cgi/SDL_GetNumAudioDevices * /sa http://wiki.libsdl.org/moin.cgi/SDL_GetAudioDeviceName */int audio_enumerateAndNameAudioDevicesNegativeTests(){ int ret; int t; int i, j, no, nc; const char *name; /* Get number of devices. */ no = SDL_GetNumAudioDevices(0); nc = SDL_GetNumAudioDevices(1); /* Invalid device index when getting name */ for (t=0; t<2; t++) { /* Negative device index */ i = -1; name = SDL_GetAudioDeviceName(i, t); AssertTrue(name == NULL, "SDL_GetAudioDeviceName(%i, %i): returned a name, should return NULL", i, t); /* Device index past range */ for (j=0; j<3; j++) { i = (t) ? nc+j : no+j; name = SDL_GetAudioDeviceName(i, t); AssertTrue(name == NULL, "SDL_GetAudioDeviceName(%i, %i): returned a name, should return NULL", i, t); } /* Capture index past capture range but within output range */ if ((no>0) && (no>nc) && (t==1)) { i = no-1; name = SDL_GetAudioDeviceName(i, t); AssertTrue(name == NULL, "SDL_GetAudioDeviceName(%i, %i): returned a name, should return NULL", i, t); } }}
开发者ID:CliffsDover,项目名称:wesnoth_ios,代码行数:39,
示例2: TestDict static void TestDict(DictPtr dict) { Optional<DictEntry> entry; entry = dict->MatchPrefix("BYVoid"); AssertTrue(!entry.IsNull()); AssertEquals("BYVoid", entry.Get().key); AssertEquals("byv", entry.Get().GetDefault()); entry = dict->MatchPrefix("BYVoid123"); AssertTrue(!entry.IsNull()); AssertEquals("BYVoid", entry.Get().key); AssertEquals("byv", entry.Get().GetDefault()); entry = dict->MatchPrefix(utf8(" C++ AssertValidStringPtr函数代码示例 C++ AssertReturnVoid函数代码示例
|