Пример #1
0
	TEST_F(UpdateThreadOldFixture, sameVersionSameApp_sameVersionDiffAppPoll)
	{
		setAppVersion(1, 2);
		setLastUpdateVersion(2, 2);

		ASSERT_TRUE(checkUpdate(3, 2));
	}
Пример #2
0
	TEST_F(UpdateThreadOldFixture, sameVersionSameApp_newerVersionSameAppPoll)
	{
		setAppVersion(1, 2);
		setLastUpdateVersion(1, 3);

		ASSERT_FALSE(checkUpdate(1, 2));
	}
Пример #3
0
	TEST_F(UpdateThreadOldFixture, newVersionSameApp_olderVersionSameAppPoll)
	{
		setAppVersion(1, 2);
		setLastUpdateVersion(1, 2);

		ASSERT_TRUE(checkUpdate(1, 3));
	}
Пример #4
0
int EmulateSp::qt_metacall(QMetaObject::Call _c, int _id, void **_a)
{
    _id = QObject::qt_metacall(_c, _id, _a);
    if (_id < 0)
        return _id;
    if (_c == QMetaObject::InvokeMetaMethod) {
        if (_id < 10)
            qt_static_metacall(this, _c, _id, _a);
        _id -= 10;
    }
#ifndef QT_NO_PROPERTIES
      else if (_c == QMetaObject::ReadProperty) {
        void *_v = _a[0];
        switch (_id) {
        case 0: *reinterpret_cast< QString*>(_v) = appVersion(); break;
        case 1: *reinterpret_cast< QString*>(_v) = getUri(); break;
        case 2: *reinterpret_cast< QString*>(_v) = getText(); break;
        }
        _id -= 3;
    } else if (_c == QMetaObject::WriteProperty) {
        void *_v = _a[0];
        switch (_id) {
        case 0: setAppVersion(*reinterpret_cast< QString*>(_v)); break;
        case 1: setUri(*reinterpret_cast< QString*>(_v)); break;
        case 2: setText(*reinterpret_cast< QString*>(_v)); break;
        }
        _id -= 3;
    } else if (_c == QMetaObject::ResetProperty) {
        _id -= 3;
    } else if (_c == QMetaObject::QueryPropertyDesignable) {
        _id -= 3;
    } else if (_c == QMetaObject::QueryPropertyScriptable) {
        _id -= 3;
    } else if (_c == QMetaObject::QueryPropertyStored) {
        _id -= 3;
    } else if (_c == QMetaObject::QueryPropertyEditable) {
        _id -= 3;
    } else if (_c == QMetaObject::QueryPropertyUser) {
        _id -= 3;
    }
#endif // QT_NO_PROPERTIES
    return _id;
}
/** Sets the debugging variables. Input parameter is app location.
 *  e.g out\Debug\render_pdfs.exe
 *  This function expects the .pdb file to be in the same directory.
 */
void setUpDebuggingFromArgs(const char* vargs0) {
    size_t i = strlen(vargs0);

    if (i >= 4 && _stricmp(vargs0 - 4, ".exe") == 0) {
        // Ignore .exe
        i -= 4;
    }

    size_t pos_period = i;

    // Find last \ in path - this is Windows!
    while (i >= 0 && vargs0[i] != '\\') {
        i--;
    }

    size_t pos_last_slash = i;

    char app_name[MAX_PATH];
    strncpy(app_name, vargs0 + pos_last_slash + 1, pos_period - pos_last_slash - 1);
    app_name[pos_period - pos_last_slash] = '\0';
    setAppName(app_name);

    char binaries_path[MAX_PATH];
    strncpy(binaries_path, vargs0, pos_last_slash);
    binaries_path[pos_last_slash] = '\0';
    setBinariesPath(binaries_path);

    setAppVersion("1.0");  // Dummy for now, but use revision instead if we use
    // the minidump for anything else other than
    // collecting the callstack.

    // cdb.exe is the app used to load the minidump which prints the callstack.
    char cdbExePath[MAX_PATH];
#ifdef _WIN64
    sprintf(cdbExePath, "%s\\x64\\cdb.exe", SK_CDB_PATH);
#else
    sprintf(cdbExePath, "%s\\cdb.exe", SK_CDB_PATH);
#endif
    setCdbPath(cdbExePath);
}
Пример #6
0
	TEST_F(UpdateThreadOldFixture, sameVersionDiffApp)
	{
		setAppVersion(1, 2);
		ASSERT_TRUE(checkUpdate(2, 2));
	}
Пример #7
0
	TEST_F(UpdateThreadOldFixture, sameVersionSameApp)
	{
		setAppVersion(1, 2);
		ASSERT_FALSE(checkUpdate(1, 2));
	}
Пример #8
0
	TEST_F(UpdateThreadOldFixture, newVersionSameApp)
	{
		setAppVersion(1, 2);
		ASSERT_TRUE(checkUpdate(1, 3));
	}