couchdb-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From kocol...@apache.org
Subject svn commit: r805649 - /couchdb/trunk/test/etap/110-replication-httpc.t
Date Wed, 19 Aug 2009 02:31:40 GMT
Author: kocolosk
Date: Wed Aug 19 02:31:40 2009
New Revision: 805649

URL: http://svn.apache.org/viewvc?rev=805649&view=rev
Log:
make httpc test work in R12B (no macros allowed)

Modified:
    couchdb/trunk/test/etap/110-replication-httpc.t

Modified: couchdb/trunk/test/etap/110-replication-httpc.t
URL: http://svn.apache.org/viewvc/couchdb/trunk/test/etap/110-replication-httpc.t?rev=805649&r1=805648&r2=805649&view=diff
==============================================================================
--- couchdb/trunk/test/etap/110-replication-httpc.t (original)
+++ couchdb/trunk/test/etap/110-replication-httpc.t Wed Aug 19 02:31:40 2009
@@ -35,8 +35,8 @@
     conn = nil
 }).
 
--define(SERVER, "http://127.0.0.1:5984/").
--define(DBNAME, "etap-test-db").
+server() -> "http://127.0.0.1:5984/".
+dbname() -> "etap-test-db".
 
 main(_) ->
     code:add_pathz("src/couchdb"),
@@ -61,8 +61,8 @@
     ibrowse:start(),
     crypto:start(),
 
-    couch_server:delete(list_to_binary(?DBNAME), []),
-    {ok, Db} = couch_db:create(list_to_binary(?DBNAME), []),
+    couch_server:delete(list_to_binary(dbname()), []),
+    {ok, Db} = couch_db:create(list_to_binary(dbname()), []),
 
     test_welcome(),
     test_binary_url(),
@@ -71,11 +71,11 @@
     test_db_exists(),
 
     couch_db:close(Db),
-    couch_server:delete(list_to_binary(?DBNAME), []),
+    couch_server:delete(list_to_binary(dbname()), []),
     ok.
 
 test_welcome() ->
-    WelcomeReq = #http_db{url=?SERVER},
+    WelcomeReq = #http_db{url=server()},
     Expect = {[
         {<<"couchdb">>, <<"Welcome">>},
         {<<"version">>, list_to_binary(couch_server:get_version())}
@@ -87,7 +87,7 @@
     ).
 
 test_binary_url() ->
-    Req = #http_db{url=list_to_binary(?SERVER)},
+    Req = #http_db{url=list_to_binary(server())},
     Expect = {[
         {<<"couchdb">>, <<"Welcome">>},
         {<<"version">>, list_to_binary(couch_server:get_version())}
@@ -100,7 +100,7 @@
 
 test_put() ->
     Req = #http_db{
-        url = ?SERVER ++ ?DBNAME ++ "/",
+        url = server() ++ dbname() ++ "/",
         resource = "test_put",
         body = {[{<<"foo">>, <<"bar">>}]},
         method = put
@@ -111,7 +111,7 @@
 
 test_qs() ->
     Req = #http_db{
-        url = ?SERVER ++ ?DBNAME ++ "/",
+        url = server() ++ dbname() ++ "/",
         resource = "foo",
         qs = [
             {bar, true},
@@ -119,7 +119,7 @@
             {bif, mochijson2:encode(<<"1-23456">>)}
         ]
     },
-    Expect = ?SERVER ++ ?DBNAME ++ "/foo?bar=true&baz=1.03&bif=\"1-23456\"",
+    Expect = server() ++ dbname() ++ "/foo?bar=true&baz=1.03&bif=\"1-23456\"",
     etap:is(
         couch_rep_httpc:full_url(Req),
         Expect,
@@ -127,7 +127,7 @@
     ).
 
 test_db_exists() ->
-    Req1 = #http_db{url=?SERVER ++ ?DBNAME ++ "/"},
-    Req2 = #http_db{url=?SERVER ++ ?DBNAME ++ "_foo/"},
+    Req1 = #http_db{url=server() ++ dbname() ++ "/"},
+    Req2 = #http_db{url=server() ++ dbname() ++ "_foo/"},
     etap:ok(couch_rep_httpc:db_exists(Req1), "db_exists true check"),
     etap:is(couch_rep_httpc:db_exists(Req2), false, "db_exists false check").



Mime
View raw message