about summary refs log tree commit diff stats
path: root/src/otr/otr.h
Commit message (Expand)AuthorAgeFilesLines
* Pass ProfChatWin to otr_on_message_sendJames Booth2015-05-021-9/+2
* Return result on OTR message sendingJames Booth2015-04-291-1/+9
* Moved otr message send event to otr moduleJames Booth2015-04-271-0/+3
* Removed server_events dependency on libotr headersJames Booth2015-04-271-0/+1
* Added otr_tag_message, removed commands.c dependency on libotrJames Booth2015-03-161-0/+2
* Updated copyrightJames Booth2015-02-101-1/+1
* Removed function pointersJames Booth2014-12-221-24/+22
* Added license exemption for OpenSSL to source headersJames Booth2014-08-241-0/+12
* Free resources on OTR shutdownJames Booth2014-06-261-0/+1
* Added deallocation function for string prefs, added otr policy enumJames Booth2014-06-181-1/+7
* Moved OTR policy check to otr moduleJames Booth2014-05-111-0/+2
* Added question answer authentication (libotr 3.2.x)James Booth2014-04-301-0/+2
* Attempt at shared secret authentication for libotr 4.0.0James Booth2014-04-281-0/+1
* Added SMP secret libotr 4.0.0 handlersJames Booth2014-04-271-0/+7
* Handle SMP secret responseJames Booth2014-04-261-1/+1
* Send SMP init message with /otr secretJames Booth2014-04-261-0/+2
* Updated copyrightJames Booth2014-03-091-1/+1
* Added OTR supported versions in initial start query messageJames Booth2014-02-181-0/+1
* Mock otr module for cmd_otr testsJames Booth2014-02-161-15/+17
* Moved otr sources into folderJames Booth2014-02-121-0/+51
336699 } /* Name.Variable.Class */ .highlight .vg { color: #dd7700 } /* Name.Variable.Global */ .highlight .vi { color: #3333bb } /* Name.Variable.Instance */ .highlight .vm { color: #336699 } /* Name.Variable.Magic */ .highlight .il { color: #0000DD; font-weight: bold } /* Literal.Number.Integer.Long */
#include "vendor/unity.h"
#include "../src/nucleotide_count.h"
#include <stdlib.h>
#include <string.h>

void setUp(void)
{
}

void tearDown(void)
{
}
#include <stdio.h>
static void test_strand_count(const char *dna_strand, const char *expected)
{
   char *actual_count = count(dna_strand);

   TEST_ASSERT_TRUE(strcmp(actual_count, expected) == 0);
   free(actual_count);
}

static void test_empty_strand(void)
{
   const char *dna_strand = "";
   const char *expected = "A:0 C:0 G:0 T:0";

   test_strand_count(dna_strand, expected);
}

static void test_repeated_nucleotide(void)
{
   const char *dna_strand = "GGGGGGG";
   const char *expected = "A:0 C:0 G:7 T:0";

   test_strand_count(dna_strand, expected);
}

static void test_multiple_nucleotides(void)
{
   const char *dna_strand =
       "AGCTTTTCATTCTGACTGCAACGGGCAATATGTCTCTGTGTGGATTAAAAAAAGAGTGTCTGATAGCAGC";
   const char *expected = "A:20 C:12 G:17 T:21";

   test_strand_count(dna_strand, expected);
}

static void test_invalid_nucleotide(void)
{
   const char *dna_strand = "AGXXACT";
   const char *expected = "";

   test_strand_count(dna_strand, expected);
}

int main(void)
{
   UnityBegin("test/test_nucleotide_count.c");

   RUN_TEST(test_empty_strand);
   RUN_TEST(test_repeated_nucleotide);
   RUN_TEST(test_multiple_nucleotides);
   RUN_TEST(test_invalid_nucleotide);

   return UnityEnd();
}