Added:
trunk/testsuites/t_ctest_function_test/
trunk/testsuites/t_ctest_function_test/simplefailure.c
trunk/testsuites/t_ctest_function_test/simpleok.c
trunk/testsuites/t_ctest_function_test/simpleskip.c
trunk/testsuites/t_ctest_function_test/simpletodo.c
trunk/testsuites/t_ctest_function_test/t_ctest_function_test.h
trunk/testsuites/t_ctest_function_test/t_ctest_function_test_suite.c
Log:
old t_susanne testsuite
tests to test the c-test functionality
Added: trunk/testsuites/t_ctest_function_test/simplefailure.c
===================================================================
--- trunk/testsuites/t_ctest_function_test/simplefailure.c 2007-05-03 11:35:02 UTC (rev
87)
+++ trunk/testsuites/t_ctest_function_test/simplefailure.c 2007-05-03 12:01:30 UTC (rev
88)
@@ -0,0 +1,15 @@
+/*
+ Simple test to demonstrate how to use it.
+*/
+
+#include "t_ctest_function_test.h"
+
+OT_TEST_METHOD(simplefailure)
+{
+ SQLHANDLE stmt;
+ test_printf("this test is to show a failure\n");
+ stmt = get_statement();
+ CHECK_SQL_S(SQLExecDirect(stmt,
+ "insert into simple2 (details, age)=('failure',144)",SQL_NTS),stmt);
+ free_statement(stmt);
+}
Added: trunk/testsuites/t_ctest_function_test/simpleok.c
===================================================================
--- trunk/testsuites/t_ctest_function_test/simpleok.c 2007-05-03 11:35:02 UTC (rev 87)
+++ trunk/testsuites/t_ctest_function_test/simpleok.c 2007-05-03 12:01:30 UTC (rev 88)
@@ -0,0 +1,16 @@
+/*
+ Simple test to demonstrate how to use it.
+*/
+
+#include "t_ctest_function_test.h"
+
+OT_TEST_METHOD(simpleok)
+{
+ SQLHANDLE stmt;
+ stmt = get_statement();
+ CHECK_SQL_S(SQLExecDirect(stmt,
+ "insert into simple2 (details, age) values ('ok',42)",SQL_NTS),stmt);
+ free_statement(stmt);
+
+ test_printf("This is a test to test a working test\n");
+}
Added: trunk/testsuites/t_ctest_function_test/simpleskip.c
===================================================================
--- trunk/testsuites/t_ctest_function_test/simpleskip.c 2007-05-03 11:35:02 UTC (rev 87)
+++ trunk/testsuites/t_ctest_function_test/simpleskip.c 2007-05-03 12:01:30 UTC (rev 88)
@@ -0,0 +1,17 @@
+/*
+ Simple test to demonstrate how to use it.
+*/
+
+#include "t_ctest_function_test.h"
+
+OT_TEST_METHOD(simpleskip)
+{
+ SQLHANDLE stmt;
+ stmt = get_statement();
+ OT_SKIP("this is a test, if skip works")
+ CHECK_SQL_S(SQLExecDirect(stmt,
+ "insert into simple2 (details, age) values ('skip',23)",SQL_NTS),stmt);
+ free_statement(stmt);
+
+ test_printf("Normally, this is a verbose debug message");
+}
Added: trunk/testsuites/t_ctest_function_test/simpletodo.c
===================================================================
--- trunk/testsuites/t_ctest_function_test/simpletodo.c 2007-05-03 11:35:02 UTC (rev 87)
+++ trunk/testsuites/t_ctest_function_test/simpletodo.c 2007-05-03 12:01:30 UTC (rev 88)
@@ -0,0 +1,41 @@
+/*
+ Simple test to demonstrate how to use it.
+*/
+
+#include "t_ctest_function_test.h"
+
+OT_TEST_METHOD(simpletodo)
+{
+ SQLHANDLE stmt;
+ OT_TODO("this is a test, if TODO works");
+ stmt = get_statement();
+ CHECK_SQL_S(SQLExecDirect(stmt,
+ "insert into simple2 (details, age) values ('todo',1024)",SQL_NTS),stmt);
+ free_statement(stmt);
+
+ test_printf("Normally, this is a verbose debug message\n");
+}
+
+OT_TEST_METHOD(simpletodofail)
+{
+ SQLHANDLE stmt;
+ OT_TODO("this is a test, if TODO works");
+ stmt = get_statement();
+ CHECK_SQL_S(SQLExecDirect(stmt,
+ "insert into simple2 (details, age)= ('todofail',1024)",SQL_NTS),stmt);
+ free_statement(stmt);
+ test_printf("Normally, this is a verbose debug message\n");
+}
+
+OT_TEST_METHOD(simpletodoskip)
+{
+ SQLHANDLE stmt;
+ OT_TODO("this is a test, if TODO works");
+ OT_SKIP("this is a test, if TODO with SKIP works");
+ stmt = get_statement();
+ CHECK_SQL_S(SQLExecDirect(stmt,
+ "insert into simple2 (details, age)= ('todoskip',1024)",SQL_NTS),stmt);
+ free_statement(stmt);
+
+ test_printf("Normally, this is a verbose debug message\n");
+}
Added: trunk/testsuites/t_ctest_function_test/t_ctest_function_test.h
===================================================================
--- trunk/testsuites/t_ctest_function_test/t_ctest_function_test.h 2007-05-03 11:35:02 UTC
(rev 87)
+++ trunk/testsuites/t_ctest_function_test/t_ctest_function_test.h 2007-05-03 12:01:30 UTC
(rev 88)
@@ -0,0 +1,11 @@
+#include "odbctest.h"
+/* test data definitions */
+extern const char *TD_DBNAME;
+
+OT_TEST_METHOD(simpleok);
+OT_TEST_METHOD(simpleskip);
+OT_TEST_METHOD(simpletodo);
+OT_TEST_METHOD(simpletodofail);
+OT_TEST_METHOD(simpletodoskip);
+OT_TEST_METHOD(simplefailure);
+
Added: trunk/testsuites/t_ctest_function_test/t_ctest_function_test_suite.c
===================================================================
--- trunk/testsuites/t_ctest_function_test/t_ctest_function_test_suite.c 2007-05-03
11:35:02 UTC (rev 87)
+++ trunk/testsuites/t_ctest_function_test/t_ctest_function_test_suite.c 2007-05-03
12:01:30 UTC (rev 88)
@@ -0,0 +1,26 @@
+#include "t_ctest_function_test.h"
+/* #include "odbctest.h" */
+
+OT_SUITE_SETUP(ctest_function_test_suite_setup)
+{
+ if (!global_connect())
+ return "Cannot create global connection!";
+ else
+ return NULL;
+}
+
+OT_SUITE_TEARDOWN(ctest_function_test_suite_teardown)
+{
+ global_disconnect();
+ return NULL;
+}
+
+OT_SUITE_REGISTER_START("ctest_function_test",ctest_function_test_suite_setup,ctest_function_test_suite_teardown)
+ OT_SUITE_ADD_TEST(simpleok, NULL, NULL);
+OT_SUITE_ADD_TEST(simpleskip, NULL, NULL);
+OT_SUITE_ADD_TEST(simpletodo, NULL, NULL);
+OT_SUITE_ADD_TEST(simpletodofail, NULL, NULL);
+OT_SUITE_ADD_TEST(simpletodoskip, NULL, NULL);
+OT_SUITE_ADD_TEST(simplefailure, NULL, NULL);
+OT_SUITE_REGISTER_END
+
| Thread |
|---|
| • ODBC C-tests commit: r88 - in trunk/testsuites: . t_ctest_function_test | sebrecht | 3 May |