Anforderungen  |   Konzepte  |   Entwurf  |   Entwicklung  |   Qualitätssicherung  |   Lebenszyklus  |   Steuerung
 
 
 
 


Quelle  TestCompatVersionCompare.cpp   Sprache: C

 
/* vim:set ts=2 sw=2 sts=2 et: */
/* Any copyright is dedicated to the Public Domain.
 * http://creativecommons.org/publicdomain/zero/1.0/
 */


#include "gtest/gtest.h"
#include "nsAppRunner.h"
#include "nsString.h"

void CheckCompatVersionCompare(const nsCString& aOldCompatVersion,
                               const nsCString& aNewCompatVersion,
                               bool aExpectedSame, bool aExpectedDowngrade) {
  printf("Comparing '%s' to '%s'.\n", aOldCompatVersion.get(),
         aNewCompatVersion.get());

  int32_t result = CompareCompatVersions(aOldCompatVersion, aNewCompatVersion);

  ASSERT_EQ(aExpectedSame, result == 0)
      << "Version sameness check should match.";
  ASSERT_EQ(aExpectedDowngrade, result > 0)
      << "Version downgrade check should match.";
}

void CheckExpectedResult(const char* aOldAppVersion, const char* aNewAppVersion,
                         bool aExpectedSame, bool aExpectedDowngrade) {
  nsCString oldCompatVersion;
  BuildCompatVersion(aOldAppVersion, """", oldCompatVersion);

  nsCString newCompatVersion;
  BuildCompatVersion(aNewAppVersion, """", newCompatVersion);

  CheckCompatVersionCompare(oldCompatVersion, newCompatVersion, aExpectedSame,
                            aExpectedDowngrade);
}

TEST(CompatVersionCompare, CompareVersionChange)
{
  // Identical
  CheckExpectedResult("67.0""67.0"truefalse);

  // Version changes
  CheckExpectedResult("67.0""68.0"falsefalse);
  CheckExpectedResult("68.0""67.0"falsetrue);
  CheckExpectedResult("67.0""67.0.1"truefalse);
  CheckExpectedResult("67.0.1""67.0"truefalse);
  CheckExpectedResult("67.0.1""67.0.1"truefalse);
  CheckExpectedResult("67.0.1""67.0.2"truefalse);
  CheckExpectedResult("67.0.2""67.0.1"truefalse);

  // Check that if the last run was safe mode then we consider this an upgrade.
  CheckCompatVersionCompare(
      "Safe Mode"_ns, "67.0.1_20000000000000/20000000000000"_ns, falsefalse);
}

Messung V0.5
C=91 H=100 G=95

¤ Dauer der Verarbeitung: 0.11 Sekunden  (vorverarbeitet)  ¤

*© Formatika GbR, Deutschland






Wurzel

Suchen

Beweissystem der NASA

Beweissystem Isabelle

NIST Cobol Testsuite

Cephes Mathematical Library

Wiener Entwicklungsmethode

Haftungshinweis

Die Informationen auf dieser Webseite wurden nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit, noch Qualität der bereit gestellten Informationen zugesichert.

Bemerkung:

Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.






                                                                                                                                                                                                                                                                                                                                                                                                     


Neuigkeiten

     Aktuelles
     Motto des Tages

Software

     Produkte
     Quellcodebibliothek

Aktivitäten

     Artikel über Sicherheit
     Anleitung zur Aktivierung von SSL

Muße

     Gedichte
     Musik
     Bilder

Jenseits des Üblichen ....
    

Besucherstatistik

Besucherstatistik

Monitoring

Montastic status badge