mirror of
https://github.com/ultimatepp/ultimatepp.git
synced 2026-06-17 22:03:37 -06:00
Bazzar: Google test example packages naming simplification.
git-svn-id: svn://ultimatepp.org/upp/trunk@14993 f0d560ea-af0d-0410-9eb7-867de7ffcac7
This commit is contained in:
parent
e39620c940
commit
eee1bd4e46
13 changed files with 27 additions and 28 deletions
16
bazaar/GtestExample/GtestExample.upp
Normal file
16
bazaar/GtestExample/GtestExample.upp
Normal file
|
|
@ -0,0 +1,16 @@
|
|||
description "Unit test package that shows how Google Test works with U++\377";
|
||||
|
||||
uses
|
||||
plugin/gtest,
|
||||
Core;
|
||||
|
||||
file
|
||||
Init readonly separator,
|
||||
main.cpp,
|
||||
Tests readonly separator,
|
||||
StringTest.cpp,
|
||||
StringTest.h;
|
||||
|
||||
mainconfig
|
||||
"" = "";
|
||||
|
||||
51
bazaar/GtestExample/StringTest.cpp
Normal file
51
bazaar/GtestExample/StringTest.cpp
Normal file
|
|
@ -0,0 +1,51 @@
|
|||
#include "StringTest.h"
|
||||
|
||||
namespace Upp {
|
||||
|
||||
void StringTest::SetUp()
|
||||
{
|
||||
sCat = "Cat";
|
||||
sDog = "Dog";
|
||||
}
|
||||
|
||||
TEST_F(StringTest, TestDefaultConstructor)
|
||||
{
|
||||
String a;
|
||||
|
||||
ASSERT_EQ(a, "");
|
||||
}
|
||||
|
||||
TEST_F(StringTest, TestConstructor)
|
||||
{
|
||||
String a("Test");
|
||||
ASSERT_EQ(a, "Test");
|
||||
}
|
||||
|
||||
TEST_F(StringTest, TestGetCount)
|
||||
{
|
||||
ASSERT_EQ(sEmpty.GetCount(), 0);
|
||||
ASSERT_EQ(sCat.GetCount(), 3);
|
||||
ASSERT_EQ(sDog.GetCount(), 3);
|
||||
}
|
||||
|
||||
TEST_F(StringTest, TestClear)
|
||||
{
|
||||
sCat.Clear();
|
||||
|
||||
ASSERT_EQ(sCat, "");
|
||||
ASSERT_EQ(sCat.GetCount(), 0);
|
||||
}
|
||||
|
||||
TEST_F(StringTest, TestCompare)
|
||||
{
|
||||
ASSERT_EQ(sCat.Compare(sCat), 0);
|
||||
ASSERT_EQ(sCat.Compare(sDog), -1);
|
||||
}
|
||||
|
||||
TEST_F(StringTest, TestEqual)
|
||||
{
|
||||
ASSERT_TRUE(sCat.IsEqual(sCat));
|
||||
ASSERT_FALSE(sCat.IsEqual(sDog));
|
||||
}
|
||||
|
||||
}
|
||||
21
bazaar/GtestExample/StringTest.h
Normal file
21
bazaar/GtestExample/StringTest.h
Normal file
|
|
@ -0,0 +1,21 @@
|
|||
#ifndef _GoogleTestExample_VectorTest_h_
|
||||
#define _GoogleTestExample_VectorTest_h_
|
||||
|
||||
#include <Core/Core.h>
|
||||
#include <plugin/gtest/gtest.h>
|
||||
|
||||
namespace Upp {
|
||||
|
||||
class StringTest : public testing::Test {
|
||||
protected:
|
||||
virtual void SetUp() override;
|
||||
|
||||
protected:
|
||||
String sEmpty;
|
||||
String sCat;
|
||||
String sDog;
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
#endif
|
||||
3
bazaar/GtestExample/main.cpp
Normal file
3
bazaar/GtestExample/main.cpp
Normal file
|
|
@ -0,0 +1,3 @@
|
|||
#include <plugin/gtest/gtest.h>
|
||||
|
||||
TEST_APP_MAIN {}
|
||||
Loading…
Add table
Add a link
Reference in a new issue