Revision 1147

trunk/tests/GNUmakefile (revision 1147)
1
GTEST_DIR=googletest-read-only
2

  
1 3
all: test-expm test-cov_re
2 4

  
3
gtest: gtest-colfill
5
run-gtests: $(GTEST_DIR)/gtest-all.o
6
	$(MAKE) --directory=gtests
4 7

  
8
all2: test-expm test-cov_re
9

  
5 10
gtest-colfill: googletest-read-only
6 11
	$(MAKE) --directory=colfill
7 12

  
13
$(GTEST_DIR)/gtest-all.o: googletest-read-only
14
	$(CXX) -c -I$(GTEST_DIR)/include -I$(GTEST_DIR) -o $@ $(GTEST_DIR)/src/gtest-all.cc
15

  
8 16
googletest-read-only:
9 17
	svn checkout http://googletest.googlecode.com/svn/trunk/ googletest-read-only
10 18

  
trunk/tests/gtests/Makefile (revision 1147)
1
GTEST_DIR=../googletest-read-only
2

  
3
all: gtest-all
4
	./gtest-all
5

  
6
gtest-all: main.cpp test_adstring_strcase.cpp test_fmm_control.cpp
7
	cp $(GTEST_DIR)/gtest-all.o .
8
	CXXFLAGS=-I$(GTEST_DIR)/include ../../admb gtest-all.o $^
9

  
10
clean:
11
	@rm -vf gtest-all gtest-all.o main.o
trunk/tests/gtests/test_adstring_strcase.cpp (revision 1147)
1
#include <gtest/gtest.h>
2
#include <fvar.hpp>
3
#include <adstring.hpp>
4

  
5
class test_adstring: public ::testing::Test {};
6

  
7
/**
8
 * Tests for errors in "void adstring::to_lower(void)"
9
 */
10
TEST_F(test_adstring, strcase_01)
11
{
12
  adstring a = "abc-123";
13
  a.to_upper();
14
  adstring expected = "ABC-123";
15
  if (a == expected)
16
  {
17
    SUCCEED();
18
    return;
19
  }
20
  FAIL();
21
}
22
/**
23
 * Tests for errors in "adstring to_upper(adstring& s)"
24
 */
25
TEST_F(test_adstring, strcase_02)
26
{
27
  adstring a = "abc-123";
28
  adstring b = to_upper(a);
29
  adstring expected = "ABC-123";
30
  if (b == expected)
31
  {
32
    SUCCEED();
33
    return;
34
  }
35
  FAIL();
36
}
37
/**
38
 * Tests for errors in "void adstring::to_upper(void)"
39
 */
40
TEST_F(test_adstring, strcase_03)
41
{
42
  adstring a = "ABC-123";
43
  a.to_lower();
44
  adstring expected = "abc-123";
45
  if (a == expected)
46
  {
47
    SUCCEED();
48
    return;
49
  }
50
  FAIL();
51
}
52
/**
53
 * Tests for errors in "adstring to_lower(adstring& s)"
54
 */
55
TEST_F(test_adstring, strcase_04)
56
{
... This diff was truncated because it exceeds the maximum size that can be displayed.

Also available in: Unified diff