From 4315192149db790f77b226a8322b57c5ef613942 Mon Sep 17 00:00:00 2001 From: Linus Nordberg Date: Fri, 25 Apr 2014 16:24:26 +0200 Subject: Clean up plop a bit. --- src/plop.erl | 12 +++--------- src/test/plop_test.erl | 6 +----- 2 files changed, 4 insertions(+), 14 deletions(-) diff --git a/src/plop.erl b/src/plop.erl index 8af6418..3cc3205 100644 --- a/src/plop.erl +++ b/src/plop.erl @@ -11,7 +11,7 @@ -include_lib("public_key/include/public_key.hrl"). -include_lib("eunit/include/eunit.hrl"). --export([start/2, loop/1, dummy_add/1]). +-export([start/2, loop/1]). -record(plop, {pubkey :: public_key:rsa_public_key(), privkey :: public_key:rsa_private_key(), @@ -62,10 +62,9 @@ handle_req(From, case Arg of {add, PlopData = #plop_data{entry = Entry}} when is_record(Entry, plop_entry) -> %% fixme: add Entry to db, - H = ht:append(Tree, serialise(Entry)), + ht:append(Tree, serialise(Entry)), SPT = spt(LogID, Privkey, PlopData), - %%io:format("adding ~p to ~p -> H: ~p, SPT: ~p~n", - [Entry, Tree, H, SPT]), + %% io:format("adding ~p to ~p -> H: ~p, SPT: ~p~n", [Entry, Tree, H, SPT]), From ! {ok, SPT}; sth -> % Signed tree head. From ! {ok, sth(Tree)}; @@ -153,11 +152,6 @@ public_key(#'RSAPrivateKey'{modulus = Mod, publicExponent = Exp}) -> #'RSAPublicKey'{modulus = Mod, publicExponent = Exp}. %%%%%%%%%%%%%%%%%%%% -%% Playing around -dummy_add(String) -> - String. - -%%%%%%%%%%%%%%%%%%%% %% Tests. serialise_test_() -> Entry = #plop_entry{type = ?PLOP_ENTRY_TYPE_X509, entry = "foo"}, diff --git a/src/test/plop_test.erl b/src/test/plop_test.erl index 0cbe5cc..6b612dd 100644 --- a/src/test/plop_test.erl +++ b/src/test/plop_test.erl @@ -8,8 +8,7 @@ adding_test_() -> fun start/0, fun stop/1, fun (Arg) -> - [test_simple_add(Arg), - test_add(Arg)] + [test_add(Arg)] end}}. start() -> @@ -22,9 +21,6 @@ stop(Pid) -> after 500 -> false end)]. -test_simple_add(Pid) -> - ?_assertEqual("foo", Pid ! plop:dummy_add("foo")). - test_add(Pid) -> TestVector = <<1,247,141,118,3,148,171,128,29,143,106,97,200,179,204,166,242,98,70,185, -- cgit v1.1